
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>Copy · 这是程序员吗</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="xishengcai">
        
        
    
    
    <link rel="stylesheet" href="../../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-toggle-chapters/toggle.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-search-plus/search.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-disqus/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-prism/prism-base16-ateliersulphurpool.light.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-advanced-emoji/emoji-website.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-anchors/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-emphasize/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-katex/katex.min.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-mermaid-gb3/mermaid/mermaid.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-sectionx/sectionx.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-donate/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-local-video/video-js.min.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-anchor-navigation-ex/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-terminal/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-alerts/style.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-versions-select/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-theme-comscore/test.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    


    

        
    
    
    
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="new_and_make.html" />
    
    
    <link rel="prev" href="./" />
    

    
    <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-chart/c3/c3.min.css">
    <script src="../../../gitbook/gitbook-plugin-chart/c3/d3.min.js"></script>
    <script src="../../../gitbook/gitbook-plugin-chart/c3/c3.min.js"></script>
    

    <script src="../../../gitbook/gitbook-plugin-graph/d3.min.js"></script>
    <script src="../../../gitbook/gitbook-plugin-graph/function-plot.js"></script>    

    
        <link rel="shortcut icon" href='../../../favicon.ico' type="image/x-icon">
    
    
        <link rel="bookmark" href='../../../favicon.ico' type="image/x-icon">
    
    
    

    <style>
    @media only screen and (max-width: 640px) {
        .book-header .hidden-mobile {
            display: none;
        }
    }
    </style>
    <script>
        window["gitbook-plugin-github-buttons"] = {"repo":"xishengcai/xisheng.blog","types":["star"],"size":"small"};
    </script>

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="https://xisheng.vip" target="_blank" class="custom-link">Home</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        <li class="header">Blog</li>
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../../">
            
                <a href="../../../">
            
                    
                        <b>1.1.</b>
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../../algorithm/">
            
                <a href="../../algorithm/">
            
                    
                        <b>1.2.</b>
                    
                    Algorithm
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../../algorithm/heap.html">
            
                <a href="../../algorithm/heap.html">
            
                    
                        <b>1.2.1.</b>
                    
                    Heap
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../../algorithm/readme.html">
            
                <a href="../../algorithm/readme.html">
            
                    
                        <b>1.2.2.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../../angular/">
            
                <a href="../../angular/">
            
                    
                        <b>1.3.</b>
                    
                    Angular
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../../angular/1-start.html">
            
                <a href="../../angular/1-start.html">
            
                    
                        <b>1.3.1.</b>
                    
                    Start
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../../angular/2-component.html">
            
                <a href="../../angular/2-component.html">
            
                    
                        <b>1.3.2.</b>
                    
                    Component
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../../angular/3-form.html">
            
                <a href="../../angular/3-form.html">
            
                    
                        <b>1.3.3.</b>
                    
                    Form
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../../angular/readme.html">
            
                <a href="../../angular/readme.html">
            
                    
                        <b>1.3.4.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../../database/">
            
                <a href="../../database/">
            
                    
                        <b>1.4.</b>
                    
                    Database
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../../database/mongodb.html">
            
                <a href="../../database/mongodb.html">
            
                    
                        <b>1.4.1.</b>
                    
                    Mongodb
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../../database/readme.html">
            
                <a href="../../database/readme.html">
            
                    
                        <b>1.4.2.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../../docker/">
            
                <a href="../../docker/">
            
                    
                        <b>1.5.</b>
                    
                    Docker
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../../docker/CentOS.html">
            
                <a href="../../docker/CentOS.html">
            
                    
                        <b>1.5.1.</b>
                    
                    CentOS
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../../docker/install.html">
            
                <a href="../../docker/install.html">
            
                    
                        <b>1.5.2.</b>
                    
                    Install
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../../docker/readme.html">
            
                <a href="../../docker/readme.html">
            
                    
                        <b>1.5.3.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="../../docker/官方shell.html">
            
                <a href="../../docker/官方shell.html">
            
                    
                        <b>1.5.4.</b>
                    
                    官方Shell
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../">
            
                <a href="../">
            
                    
                        <b>1.6.</b>
                    
                    Golang
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../aop.html">
            
                <a href="../aop.html">
            
                    
                        <b>1.6.1.</b>
                    
                    Aop
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="./">
            
                <a href="./">
            
                    
                        <b>1.6.2.</b>
                    
                    Base
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="1.6.2.1" data-path="copy.html">
            
                <a href="copy.html">
            
                    
                        <b>1.6.2.1.</b>
                    
                    Copy
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.2" data-path="new_and_make.html">
            
                <a href="new_and_make.html">
            
                    
                        <b>1.6.2.2.</b>
                    
                    New And Make
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.3" data-path="readme.html">
            
                <a href="readme.html">
            
                    
                        <b>1.6.2.3.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.4" data-path="reflect.html">
            
                <a href="reflect.html">
            
                    
                        <b>1.6.2.4.</b>
                    
                    Reflect
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.5" data-path="string.html">
            
                <a href="string.html">
            
                    
                        <b>1.6.2.5.</b>
                    
                    String
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.6" data-path="tag.html">
            
                <a href="tag.html">
            
                    
                        <b>1.6.2.6.</b>
                    
                    Tag
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../clouser.html">
            
                <a href="../clouser.html">
            
                    
                        <b>1.6.3.</b>
                    
                    Clouser
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../err 优雅处理.html">
            
                <a href="../err 优雅处理.html">
            
                    
                        <b>1.6.4.</b>
                    
                    Err 优雅处理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="../go module 2.html">
            
                <a href="../go module 2.html">
            
                    
                        <b>1.6.5.</b>
                    
                    Go Module 2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" data-path="../go_mod.html">
            
                <a href="../go_mod.html">
            
                    
                        <b>1.6.6.</b>
                    
                    Go Mod
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" data-path="../gocraftwork.html">
            
                <a href="../gocraftwork.html">
            
                    
                        <b>1.6.7.</b>
                    
                    Gocraftwork
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.8" data-path="../oauth.html">
            
                <a href="../oauth.html">
            
                    
                        <b>1.6.8.</b>
                    
                    Oauth
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.9" data-path="../readme.html">
            
                <a href="../readme.html">
            
                    
                        <b>1.6.9.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.10" data-path="../swagger.html">
            
                <a href="../swagger.html">
            
                    
                        <b>1.6.10.</b>
                    
                    Swagger
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.11" data-path="../tls.html">
            
                <a href="../tls.html">
            
                    
                        <b>1.6.11.</b>
                    
                    Tls
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.12" >
            
                <span>
            
                    
                        <b>1.6.12.</b>
                    
                    代码走读
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.12.1" data-path="../代码走读/2020.5.26.html">
            
                <a href="../代码走读/2020.5.26.html">
            
                    
                        <b>1.6.12.1.</b>
                    
                    2020.5.26
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.13" data-path="../任务队列/">
            
                <a href="../任务队列/">
            
                    
                        <b>1.6.13.</b>
                    
                    任务队列
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.13.1" data-path="../任务队列/gocraft-worker.html">
            
                <a href="../任务队列/gocraft-worker.html">
            
                    
                        <b>1.6.13.1.</b>
                    
                    Gocraft Worker
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.13.2" data-path="../任务队列/readme.html">
            
                <a href="../任务队列/readme.html">
            
                    
                        <b>1.6.13.2.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.14" data-path="../参数校验.html">
            
                <a href="../参数校验.html">
            
                    
                        <b>1.6.14.</b>
                    
                    参数校验
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../../istio/">
            
                <a href="../../istio/">
            
                    
                        <b>1.7.</b>
                    
                    Istio
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../../istio/readme.html">
            
                <a href="../../istio/readme.html">
            
                    
                        <b>1.7.1.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../../istio/virtualservice.html">
            
                <a href="../../istio/virtualservice.html">
            
                    
                        <b>1.7.2.</b>
                    
                    Virtualservice
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" >
            
                <span>
            
                    
                        <b>1.8.</b>
                    
                    Java
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../../java/jvm.html">
            
                <a href="../../java/jvm.html">
            
                    
                        <b>1.8.1.</b>
                    
                    Jvm
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../../java/typescript.html">
            
                <a href="../../java/typescript.html">
            
                    
                        <b>1.8.2.</b>
                    
                    Typescript
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../../kubernetes/">
            
                <a href="../../kubernetes/">
            
                    
                        <b>1.9.</b>
                    
                    Kubernetes
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" data-path="../../kubernetes/APIService.html">
            
                <a href="../../kubernetes/APIService.html">
            
                    
                        <b>1.9.1.</b>
                    
                    APIService
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2" data-path="../../kubernetes/CAK.html">
            
                <a href="../../kubernetes/CAK.html">
            
                    
                        <b>1.9.2.</b>
                    
                    CAK
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.3" data-path="../../kubernetes/Deployment 的实现原理.html">
            
                <a href="../../kubernetes/Deployment 的实现原理.html">
            
                    
                        <b>1.9.3.</b>
                    
                    Deployment 的实现原理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4" data-path="../../kubernetes/K8s源码/">
            
                <a href="../../kubernetes/K8s源码/">
            
                    
                        <b>1.9.4.</b>
                    
                    K8s源码
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.4.1" data-path="../../kubernetes/K8s源码/calico 源码分析.html">
            
                <a href="../../kubernetes/K8s源码/calico 源码分析.html">
            
                    
                        <b>1.9.4.1.</b>
                    
                    Calico 源码分析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.2" data-path="../../kubernetes/K8s源码/garbage collector controller 源码分析.html">
            
                <a href="../../kubernetes/K8s源码/garbage collector controller 源码分析.html">
            
                    
                        <b>1.9.4.2.</b>
                    
                    Garbage Collector Controller 源码分析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.3" data-path="../../kubernetes/K8s源码/job.html">
            
                <a href="../../kubernetes/K8s源码/job.html">
            
                    
                        <b>1.9.4.3.</b>
                    
                    Job
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.4" data-path="../../kubernetes/K8s源码/kube-proxy-iptables.html">
            
                <a href="../../kubernetes/K8s源码/kube-proxy-iptables.html">
            
                    
                        <b>1.9.4.4.</b>
                    
                    Kube Proxy Iptables
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.5" data-path="../../kubernetes/K8s源码/kube-proxy-ipvs.html">
            
                <a href="../../kubernetes/K8s源码/kube-proxy-ipvs.html">
            
                    
                        <b>1.9.4.5.</b>
                    
                    Kube Proxy Ipvs
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.6" data-path="../../kubernetes/K8s源码/kube-proxy.html">
            
                <a href="../../kubernetes/K8s源码/kube-proxy.html">
            
                    
                        <b>1.9.4.6.</b>
                    
                    Kube Proxy
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.7" data-path="../../kubernetes/K8s源码/kubectl-exec.html">
            
                <a href="../../kubernetes/K8s源码/kubectl-exec.html">
            
                    
                        <b>1.9.4.7.</b>
                    
                    Kubectl Exec
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.8" data-path="../../kubernetes/K8s源码/kubectl源码阅读1.html">
            
                <a href="../../kubernetes/K8s源码/kubectl源码阅读1.html">
            
                    
                        <b>1.9.4.8.</b>
                    
                    Kubectl源码阅读1
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.9" data-path="../../kubernetes/K8s源码/kubectl源码阅读2.html">
            
                <a href="../../kubernetes/K8s源码/kubectl源码阅读2.html">
            
                    
                        <b>1.9.4.9.</b>
                    
                    Kubectl源码阅读2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.10" data-path="../../kubernetes/K8s源码/readme.html">
            
                <a href="../../kubernetes/K8s源码/readme.html">
            
                    
                        <b>1.9.4.10.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.11" data-path="../../kubernetes/K8s源码/schedule.html">
            
                <a href="../../kubernetes/K8s源码/schedule.html">
            
                    
                        <b>1.9.4.11.</b>
                    
                    Schedule
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.12" data-path="../../kubernetes/K8s源码/scheme.html">
            
                <a href="../../kubernetes/K8s源码/scheme.html">
            
                    
                        <b>1.9.4.12.</b>
                    
                    Scheme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.13" data-path="../../kubernetes/K8s源码/调度队列.html">
            
                <a href="../../kubernetes/K8s源码/调度队列.html">
            
                    
                        <b>1.9.4.13.</b>
                    
                    调度队列
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9.5" data-path="../../kubernetes/Karmada.html">
            
                <a href="../../kubernetes/Karmada.html">
            
                    
                        <b>1.9.5.</b>
                    
                    Karmada
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.6" data-path="../../kubernetes/Pixie.html">
            
                <a href="../../kubernetes/Pixie.html">
            
                    
                        <b>1.9.6.</b>
                    
                    Pixie
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.7" data-path="../../kubernetes/admission access.html">
            
                <a href="../../kubernetes/admission access.html">
            
                    
                        <b>1.9.7.</b>
                    
                    Admission Access
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.8" data-path="../../kubernetes/ccm.html">
            
                <a href="../../kubernetes/ccm.html">
            
                    
                        <b>1.9.8.</b>
                    
                    Ccm
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.9" data-path="../../kubernetes/client-go.html">
            
                <a href="../../kubernetes/client-go.html">
            
                    
                        <b>1.9.9.</b>
                    
                    Client Go
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.10" data-path="../../kubernetes/command.html">
            
                <a href="../../kubernetes/command.html">
            
                    
                        <b>1.9.10.</b>
                    
                    Command
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.11" data-path="../../kubernetes/controller.html">
            
                <a href="../../kubernetes/controller.html">
            
                    
                        <b>1.9.11.</b>
                    
                    Controller
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.12" data-path="../../kubernetes/copy docker config.html">
            
                <a href="../../kubernetes/copy docker config.html">
            
                    
                        <b>1.9.12.</b>
                    
                    Copy Docker Config
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.13" data-path="../../kubernetes/etcd-operation.html">
            
                <a href="../../kubernetes/etcd-operation.html">
            
                    
                        <b>1.9.13.</b>
                    
                    Etcd Operation
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.14" data-path="../../kubernetes/gc.html">
            
                <a href="../../kubernetes/gc.html">
            
                    
                        <b>1.9.14.</b>
                    
                    Gc
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.15" data-path="../../kubernetes/helm chart.html">
            
                <a href="../../kubernetes/helm chart.html">
            
                    
                        <b>1.9.15.</b>
                    
                    Helm Chart
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.16" data-path="../../kubernetes/helm.html">
            
                <a href="../../kubernetes/helm.html">
            
                    
                        <b>1.9.16.</b>
                    
                    Helm
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.17" >
            
                <span>
            
                    
                        <b>1.9.17.</b>
                    
                    Helm
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.17.1" data-path="../../kubernetes/helm/charts.html">
            
                <a href="../../kubernetes/helm/charts.html">
            
                    
                        <b>1.9.17.1.</b>
                    
                    Charts
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.17.2" data-path="../../kubernetes/helm/helm 钩子函数.html">
            
                <a href="../../kubernetes/helm/helm 钩子函数.html">
            
                    
                        <b>1.9.17.2.</b>
                    
                    Helm 钩子函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.17.3" data-path="../../kubernetes/helm/helm-operator.html">
            
                <a href="../../kubernetes/helm/helm-operator.html">
            
                    
                        <b>1.9.17.3.</b>
                    
                    Helm Operator
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.17.4" data-path="../../kubernetes/helm/文档查询.html">
            
                <a href="../../kubernetes/helm/文档查询.html">
            
                    
                        <b>1.9.17.4.</b>
                    
                    文档查询
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.17.5" data-path="../../kubernetes/helm/语法.html">
            
                <a href="../../kubernetes/helm/语法.html">
            
                    
                        <b>1.9.17.5.</b>
                    
                    语法
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9.18" data-path="../../kubernetes/install.html">
            
                <a href="../../kubernetes/install.html">
            
                    
                        <b>1.9.18.</b>
                    
                    Install
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.19" data-path="../../kubernetes/istio-inject.html">
            
                <a href="../../kubernetes/istio-inject.html">
            
                    
                        <b>1.9.19.</b>
                    
                    Istio Inject
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.20" >
            
                <span>
            
                    
                        <b>1.9.20.</b>
                    
                    KubeEdge
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.21" data-path="../../kubernetes/kuber-apiserver-flag.html">
            
                <a href="../../kubernetes/kuber-apiserver-flag.html">
            
                    
                        <b>1.9.21.</b>
                    
                    Kuber Apiserver Flag
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.22" data-path="../../kubernetes/kubernetes-client.html">
            
                <a href="../../kubernetes/kubernetes-client.html">
            
                    
                        <b>1.9.22.</b>
                    
                    Kubernetes Client
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.23" data-path="../../kubernetes/kubernetes灾备.html">
            
                <a href="../../kubernetes/kubernetes灾备.html">
            
                    
                        <b>1.9.23.</b>
                    
                    Kubernetes灾备
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.24" data-path="../../kubernetes/kubesphere/">
            
                <a href="../../kubernetes/kubesphere/">
            
                    
                        <b>1.9.24.</b>
                    
                    Kubesphere
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.24.1" data-path="../../kubernetes/kubesphere/helm.html">
            
                <a href="../../kubernetes/kubesphere/helm.html">
            
                    
                        <b>1.9.24.1.</b>
                    
                    Helm
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.24.2" data-path="../../kubernetes/kubesphere/readme.html">
            
                <a href="../../kubernetes/kubesphere/readme.html">
            
                    
                        <b>1.9.24.2.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9.25" data-path="../../kubernetes/kubevela/">
            
                <a href="../../kubernetes/kubevela/">
            
                    
                        <b>1.9.25.</b>
                    
                    Kubevela
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.25.1" data-path="../../kubernetes/kubevela/KubeVela 功能.html">
            
                <a href="../../kubernetes/kubevela/KubeVela 功能.html">
            
                    
                        <b>1.9.25.1.</b>
                    
                    KubeVela 功能
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.25.2" data-path="../../kubernetes/kubevela/cue.html">
            
                <a href="../../kubernetes/kubevela/cue.html">
            
                    
                        <b>1.9.25.2.</b>
                    
                    Cue
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.25.3" data-path="../../kubernetes/kubevela/oam.html">
            
                <a href="../../kubernetes/kubevela/oam.html">
            
                    
                        <b>1.9.25.3.</b>
                    
                    Oam
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.25.4" data-path="../../kubernetes/kubevela/readme.html">
            
                <a href="../../kubernetes/kubevela/readme.html">
            
                    
                        <b>1.9.25.4.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.25.5" data-path="../../kubernetes/kubevela/rollout design.html">
            
                <a href="../../kubernetes/kubevela/rollout design.html">
            
                    
                        <b>1.9.25.5.</b>
                    
                    Rollout Design
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.25.6" data-path="../../kubernetes/kubevela/vela run.html">
            
                <a href="../../kubernetes/kubevela/vela run.html">
            
                    
                        <b>1.9.25.6.</b>
                    
                    Vela Run
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.25.7" data-path="../../kubernetes/kubevela/vela up.html">
            
                <a href="../../kubernetes/kubevela/vela up.html">
            
                    
                        <b>1.9.25.7.</b>
                    
                    Vela Up
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.25.8" data-path="../../kubernetes/kubevela/vela-cluster.html">
            
                <a href="../../kubernetes/kubevela/vela-cluster.html">
            
                    
                        <b>1.9.25.8.</b>
                    
                    Vela Cluster
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.25.9" data-path="../../kubernetes/kubevela/vela-helm.html">
            
                <a href="../../kubernetes/kubevela/vela-helm.html">
            
                    
                        <b>1.9.25.9.</b>
                    
                    Vela Helm
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.25.10" data-path="../../kubernetes/kubevela/vela-pk-oam.html">
            
                <a href="../../kubernetes/kubevela/vela-pk-oam.html">
            
                    
                        <b>1.9.25.10.</b>
                    
                    Vela Pk Oam
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9.26" data-path="../../kubernetes/mk-cert.html">
            
                <a href="../../kubernetes/mk-cert.html">
            
                    
                        <b>1.9.26.</b>
                    
                    Mk Cert
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.27" data-path="../../kubernetes/open_swagger-ui.html">
            
                <a href="../../kubernetes/open_swagger-ui.html">
            
                    
                        <b>1.9.27.</b>
                    
                    Open Swagger Ui
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.28" data-path="../../kubernetes/readme.html">
            
                <a href="../../kubernetes/readme.html">
            
                    
                        <b>1.9.28.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.29" data-path="../../kubernetes/task/">
            
                <a href="../../kubernetes/task/">
            
                    
                        <b>1.9.29.</b>
                    
                    Task
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.29.1" data-path="../../kubernetes/task/HPA.html">
            
                <a href="../../kubernetes/task/HPA.html">
            
                    
                        <b>1.9.29.1.</b>
                    
                    HPA
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.29.2" data-path="../../kubernetes/task/kubectl patch.html">
            
                <a href="../../kubernetes/task/kubectl patch.html">
            
                    
                        <b>1.9.29.2.</b>
                    
                    Kubectl Patch
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.29.3" data-path="../../kubernetes/task/pod 信息注入.html">
            
                <a href="../../kubernetes/task/pod 信息注入.html">
            
                    
                        <b>1.9.29.3.</b>
                    
                    Pod 信息注入
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.29.4" data-path="../../kubernetes/task/pod 垂直扩缩容.html">
            
                <a href="../../kubernetes/task/pod 垂直扩缩容.html">
            
                    
                        <b>1.9.29.4.</b>
                    
                    Pod 垂直扩缩容
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.29.5" data-path="../../kubernetes/task/readme.html">
            
                <a href="../../kubernetes/task/readme.html">
            
                    
                        <b>1.9.29.5.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.29.6" data-path="../../kubernetes/task/server-side-apply.html">
            
                <a href="../../kubernetes/task/server-side-apply.html">
            
                    
                        <b>1.9.29.6.</b>
                    
                    Server Side Apply
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.29.7" data-path="../../kubernetes/task/准入控制.html">
            
                <a href="../../kubernetes/task/准入控制.html">
            
                    
                        <b>1.9.29.7.</b>
                    
                    准入控制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.29.8" data-path="../../kubernetes/task/聚合api.html">
            
                <a href="../../kubernetes/task/聚合api.html">
            
                    
                        <b>1.9.29.8.</b>
                    
                    聚合Api
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.29.9" data-path="../../kubernetes/task/资源预留配置.html">
            
                <a href="../../kubernetes/task/资源预留配置.html">
            
                    
                        <b>1.9.29.9.</b>
                    
                    资源预留配置
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9.30" data-path="../../kubernetes/webhook.html">
            
                <a href="../../kubernetes/webhook.html">
            
                    
                        <b>1.9.30.</b>
                    
                    Webhook
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.31" data-path="../../kubernetes/一致性认证.html">
            
                <a href="../../kubernetes/一致性认证.html">
            
                    
                        <b>1.9.31.</b>
                    
                    一致性认证
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.32" data-path="../../kubernetes/专利名词.html">
            
                <a href="../../kubernetes/专利名词.html">
            
                    
                        <b>1.9.32.</b>
                    
                    专利名词
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.33" data-path="../../kubernetes/删除namespace.html">
            
                <a href="../../kubernetes/删除namespace.html">
            
                    
                        <b>1.9.33.</b>
                    
                    删除Namespace
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.34" data-path="../../kubernetes/简化多集群.html">
            
                <a href="../../kubernetes/简化多集群.html">
            
                    
                        <b>1.9.34.</b>
                    
                    简化多集群
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.35" data-path="../../kubernetes/网络插件/">
            
                <a href="../../kubernetes/网络插件/">
            
                    
                        <b>1.9.35.</b>
                    
                    网络插件
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.35.1" data-path="../../kubernetes/网络插件/calico.html">
            
                <a href="../../kubernetes/网络插件/calico.html">
            
                    
                        <b>1.9.35.1.</b>
                    
                    Calico
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.35.2" data-path="../../kubernetes/网络插件/cilium.html">
            
                <a href="../../kubernetes/网络插件/cilium.html">
            
                    
                        <b>1.9.35.2.</b>
                    
                    Cilium
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.35.3" data-path="../../kubernetes/网络插件/ebpf.html">
            
                <a href="../../kubernetes/网络插件/ebpf.html">
            
                    
                        <b>1.9.35.3.</b>
                    
                    Ebpf
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.35.4" data-path="../../kubernetes/网络插件/readme.html">
            
                <a href="../../kubernetes/网络插件/readme.html">
            
                    
                        <b>1.9.35.4.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9.36" data-path="../../kubernetes/镜像/">
            
                <a href="../../kubernetes/镜像/">
            
                    
                        <b>1.9.36.</b>
                    
                    镜像
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.36.1" data-path="../../kubernetes/镜像/Containerd Stargz Snapshotter.html">
            
                <a href="../../kubernetes/镜像/Containerd Stargz Snapshotter.html">
            
                    
                        <b>1.9.36.1.</b>
                    
                    Containerd Stargz Snapshotter
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.36.2" data-path="../../kubernetes/镜像/OCI.html">
            
                <a href="../../kubernetes/镜像/OCI.html">
            
                    
                        <b>1.9.36.2.</b>
                    
                    OCI
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.36.3" data-path="../../kubernetes/镜像/harbor/">
            
                <a href="../../kubernetes/镜像/harbor/">
            
                    
                        <b>1.9.36.3.</b>
                    
                    Harbor
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.36.3.1" data-path="../../kubernetes/镜像/harbor/readme.html">
            
                <a href="../../kubernetes/镜像/harbor/readme.html">
            
                    
                        <b>1.9.36.3.1.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9.36.4" data-path="../../kubernetes/镜像/readme.html">
            
                <a href="../../kubernetes/镜像/readme.html">
            
                    
                        <b>1.9.36.4.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.36.5" data-path="../../kubernetes/镜像/自动构建镜像.html">
            
                <a href="../../kubernetes/镜像/自动构建镜像.html">
            
                    
                        <b>1.9.36.5.</b>
                    
                    自动构建镜像
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.36.6" data-path="../../kubernetes/镜像/镜像加速方案.html">
            
                <a href="../../kubernetes/镜像/镜像加速方案.html">
            
                    
                        <b>1.9.36.6.</b>
                    
                    镜像加速方案
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.36.7" data-path="../../kubernetes/镜像/镜像延迟加载技术解析.html">
            
                <a href="../../kubernetes/镜像/镜像延迟加载技术解析.html">
            
                    
                        <b>1.9.36.7.</b>
                    
                    镜像延迟加载技术解析
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../../math/">
            
                <a href="../../math/">
            
                    
                        <b>1.10.</b>
                    
                    Math
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.10.1" data-path="../../math/readme.html">
            
                <a href="../../math/readme.html">
            
                    
                        <b>1.10.1.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.2" data-path="../../math/泊松分布.html">
            
                <a href="../../math/泊松分布.html">
            
                    
                        <b>1.10.2.</b>
                    
                    泊松分布
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="../../效率/">
            
                <a href="../../效率/">
            
                    
                        <b>1.11.</b>
                    
                    效率
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.11.1" data-path="../../效率/cat.html">
            
                <a href="../../效率/cat.html">
            
                    
                        <b>1.11.1.</b>
                    
                    Cat
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2" data-path="../../效率/docker volume clean.html">
            
                <a href="../../效率/docker volume clean.html">
            
                    
                        <b>1.11.2.</b>
                    
                    Docker Volume Clean
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.3" data-path="../../效率/git book.html">
            
                <a href="../../效率/git book.html">
            
                    
                        <b>1.11.3.</b>
                    
                    Git Book
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.4" data-path="../../效率/git.html">
            
                <a href="../../效率/git.html">
            
                    
                        <b>1.11.4.</b>
                    
                    Git
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.5" data-path="../../效率/linux command.html">
            
                <a href="../../效率/linux command.html">
            
                    
                        <b>1.11.5.</b>
                    
                    Linux Command
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.6" data-path="../../效率/linux 内核.html">
            
                <a href="../../效率/linux 内核.html">
            
                    
                        <b>1.11.6.</b>
                    
                    Linux 内核
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.7" data-path="../../效率/macos path.html">
            
                <a href="../../效率/macos path.html">
            
                    
                        <b>1.11.7.</b>
                    
                    Macos Path
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.8" data-path="../../效率/nfs.html">
            
                <a href="../../效率/nfs.html">
            
                    
                        <b>1.11.8.</b>
                    
                    Nfs
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.9" data-path="../../效率/nginx.html">
            
                <a href="../../效率/nginx.html">
            
                    
                        <b>1.11.9.</b>
                    
                    Nginx
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.10" data-path="../../效率/nginx2.html">
            
                <a href="../../效率/nginx2.html">
            
                    
                        <b>1.11.10.</b>
                    
                    Nginx2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.11" data-path="../../效率/oauth2.html">
            
                <a href="../../效率/oauth2.html">
            
                    
                        <b>1.11.11.</b>
                    
                    Oauth2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.12" data-path="../../效率/ovftool.html">
            
                <a href="../../效率/ovftool.html">
            
                    
                        <b>1.11.12.</b>
                    
                    Ovftool
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.13" data-path="../../效率/readme.html">
            
                <a href="../../效率/readme.html">
            
                    
                        <b>1.11.13.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.14" data-path="../../效率/sed.html">
            
                <a href="../../效率/sed.html">
            
                    
                        <b>1.11.14.</b>
                    
                    Sed
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.15" data-path="../../效率/shell_judge.html">
            
                <a href="../../效率/shell_judge.html">
            
                    
                        <b>1.11.15.</b>
                    
                    Shell Judge
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.16" data-path="../../效率/sshpass.html">
            
                <a href="../../效率/sshpass.html">
            
                    
                        <b>1.11.16.</b>
                    
                    Sshpass
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.17" data-path="../../效率/telepresence.html">
            
                <a href="../../效率/telepresence.html">
            
                    
                        <b>1.11.17.</b>
                    
                    Telepresence
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.18" data-path="../../效率/typora.html">
            
                <a href="../../效率/typora.html">
            
                    
                        <b>1.11.18.</b>
                    
                    Typora
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.19" data-path="../../效率/url encode.html">
            
                <a href="../../效率/url encode.html">
            
                    
                        <b>1.11.19.</b>
                    
                    Url Encode
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.20" data-path="../../效率/vim.html">
            
                <a href="../../效率/vim.html">
            
                    
                        <b>1.11.20.</b>
                    
                    Vim
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.21" data-path="../../效率/yum.html">
            
                <a href="../../效率/yum.html">
            
                    
                        <b>1.11.21.</b>
                    
                    Yum
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.22" data-path="../../效率/内网穿透.html">
            
                <a href="../../效率/内网穿透.html">
            
                    
                        <b>1.11.22.</b>
                    
                    内网穿透
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.23" data-path="../../效率/科学上网.html">
            
                <a href="../../效率/科学上网.html">
            
                    
                        <b>1.11.23.</b>
                    
                    科学上网
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.24" data-path="../../效率/证书制作.html">
            
                <a href="../../效率/证书制作.html">
            
                    
                        <b>1.11.24.</b>
                    
                    证书制作
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.12" >
            
                <span>
            
                    
                        <b>1.12.</b>
                    
                    杂谈
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.12.1" data-path="../../杂谈/论好文章和烂文章.html">
            
                <a href="../../杂谈/论好文章和烂文章.html">
            
                    
                        <b>1.12.1.</b>
                    
                    论好文章和烂文章
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="../../测试/">
            
                <a href="../../测试/">
            
                    
                        <b>1.13.</b>
                    
                    测试
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.13.1" data-path="../../测试/ginkgo/">
            
                <a href="../../测试/ginkgo/">
            
                    
                        <b>1.13.1.</b>
                    
                    Ginkgo
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.13.1.1" data-path="../../测试/ginkgo/ginkgo.html">
            
                <a href="../../测试/ginkgo/ginkgo.html">
            
                    
                        <b>1.13.1.1.</b>
                    
                    Ginkgo
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.1.2" data-path="../../测试/ginkgo/ginkgo_cmd.html">
            
                <a href="../../测试/ginkgo/ginkgo_cmd.html">
            
                    
                        <b>1.13.1.2.</b>
                    
                    Ginkgo Cmd
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.1.3" data-path="../../测试/ginkgo/readme.html">
            
                <a href="../../测试/ginkgo/readme.html">
            
                    
                        <b>1.13.1.3.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.13.2" data-path="../../测试/golang-test.html">
            
                <a href="../../测试/golang-test.html">
            
                    
                        <b>1.13.2.</b>
                    
                    Golang Test
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.3" data-path="../../测试/http测试.html">
            
                <a href="../../测试/http测试.html">
            
                    
                        <b>1.13.3.</b>
                    
                    Http测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.4" data-path="../../测试/readme.html">
            
                <a href="../../测试/readme.html">
            
                    
                        <b>1.13.4.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.5" data-path="../../测试/其他功能.html">
            
                <a href="../../测试/其他功能.html">
            
                    
                        <b>1.13.5.</b>
                    
                    其他功能
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.6" data-path="../../测试/单元测试.html">
            
                <a href="../../测试/单元测试.html">
            
                    
                        <b>1.13.6.</b>
                    
                    单元测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.7" data-path="../../测试/单元测试2.html">
            
                <a href="../../测试/单元测试2.html">
            
                    
                        <b>1.13.7.</b>
                    
                    单元测试2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.8" data-path="../../测试/基准测试.html">
            
                <a href="../../测试/基准测试.html">
            
                    
                        <b>1.13.8.</b>
                    
                    基准测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.9" data-path="../../测试/子测试与子基准测试.html">
            
                <a href="../../测试/子测试与子基准测试.html">
            
                    
                        <b>1.13.9.</b>
                    
                    子测试与子基准测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.10" data-path="../../测试/并行测试.html">
            
                <a href="../../测试/并行测试.html">
            
                    
                        <b>1.13.10.</b>
                    
                    并行测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.11" data-path="../../测试/质量检查/">
            
                <a href="../../测试/质量检查/">
            
                    
                        <b>1.13.11.</b>
                    
                    质量检查
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.13.11.1" data-path="../../测试/质量检查/Sonar.html">
            
                <a href="../../测试/质量检查/Sonar.html">
            
                    
                        <b>1.13.11.1.</b>
                    
                    Sonar
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.11.2" data-path="../../测试/质量检查/go_lint.html">
            
                <a href="../../测试/质量检查/go_lint.html">
            
                    
                        <b>1.13.11.2.</b>
                    
                    Go Lint
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.11.3" data-path="../../测试/质量检查/readme.html">
            
                <a href="../../测试/质量检查/readme.html">
            
                    
                        <b>1.13.11.3.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="../../规范/">
            
                <a href="../../规范/">
            
                    
                        <b>1.14.</b>
                    
                    规范
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.14.1" data-path="../../规范/CodeReviewComments.html">
            
                <a href="../../规范/CodeReviewComments.html">
            
                    
                        <b>1.14.1.</b>
                    
                    CodeReviewComments
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.2" data-path="../../规范/git规范.html">
            
                <a href="../../规范/git规范.html">
            
                    
                        <b>1.14.2.</b>
                    
                    Git规范
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.3" data-path="../../规范/golang 代码规范.html">
            
                <a href="../../规范/golang 代码规范.html">
            
                    
                        <b>1.14.3.</b>
                    
                    Golang 代码规范
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.4" data-path="../../规范/readme.html">
            
                <a href="../../规范/readme.html">
            
                    
                        <b>1.14.4.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.5" data-path="../../规范/代码走读.html">
            
                <a href="../../规范/代码走读.html">
            
                    
                        <b>1.14.5.</b>
                    
                    代码走读
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.15" data-path="../../设计模式/">
            
                <a href="../../设计模式/">
            
                    
                        <b>1.15.</b>
                    
                    设计模式
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.15.1" data-path="../../设计模式/readme.html">
            
                <a href="../../设计模式/readme.html">
            
                    
                        <b>1.15.1.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.2" data-path="../../设计模式/创建模型/">
            
                <a href="../../设计模式/创建模型/">
            
                    
                        <b>1.15.2.</b>
                    
                    创建模型
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.15.2.1" data-path="../../设计模式/创建模型/readme.html">
            
                <a href="../../设计模式/创建模型/readme.html">
            
                    
                        <b>1.15.2.1.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.2.2" data-path="../../设计模式/创建模型/创建者模型.html">
            
                <a href="../../设计模式/创建模型/创建者模型.html">
            
                    
                        <b>1.15.2.2.</b>
                    
                    创建者模型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.2.3" data-path="../../设计模式/创建模型/单例模式.html">
            
                <a href="../../设计模式/创建模型/单例模式.html">
            
                    
                        <b>1.15.2.3.</b>
                    
                    单例模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.2.4" data-path="../../设计模式/创建模型/原型模式.html">
            
                <a href="../../设计模式/创建模型/原型模式.html">
            
                    
                        <b>1.15.2.4.</b>
                    
                    原型模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.2.5" data-path="../../设计模式/创建模型/工厂方法.html">
            
                <a href="../../设计模式/创建模型/工厂方法.html">
            
                    
                        <b>1.15.2.5.</b>
                    
                    工厂方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.2.6" data-path="../../设计模式/创建模型/抽象工厂.html">
            
                <a href="../../设计模式/创建模型/抽象工厂.html">
            
                    
                        <b>1.15.2.6.</b>
                    
                    抽象工厂
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.2.7" data-path="../../设计模式/创建模型/简单工厂.html">
            
                <a href="../../设计模式/创建模型/简单工厂.html">
            
                    
                        <b>1.15.2.7.</b>
                    
                    简单工厂
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.15.3" data-path="../../设计模式/结构型模型/">
            
                <a href="../../设计模式/结构型模型/">
            
                    
                        <b>1.15.3.</b>
                    
                    结构型模型
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.15.3.1" data-path="../../设计模式/结构型模型/readme.html">
            
                <a href="../../设计模式/结构型模型/readme.html">
            
                    
                        <b>1.15.3.1.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.3.2" data-path="../../设计模式/结构型模型/享元模式.html">
            
                <a href="../../设计模式/结构型模型/享元模式.html">
            
                    
                        <b>1.15.3.2.</b>
                    
                    享元模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.3.3" data-path="../../设计模式/结构型模型/代理模式.html">
            
                <a href="../../设计模式/结构型模型/代理模式.html">
            
                    
                        <b>1.15.3.3.</b>
                    
                    代理模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.3.4" data-path="../../设计模式/结构型模型/外观模式.html">
            
                <a href="../../设计模式/结构型模型/外观模式.html">
            
                    
                        <b>1.15.3.4.</b>
                    
                    外观模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.3.5" data-path="../../设计模式/结构型模型/桥模式.html">
            
                <a href="../../设计模式/结构型模型/桥模式.html">
            
                    
                        <b>1.15.3.5.</b>
                    
                    桥模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.3.6" data-path="../../设计模式/结构型模型/组合模式.html">
            
                <a href="../../设计模式/结构型模型/组合模式.html">
            
                    
                        <b>1.15.3.6.</b>
                    
                    组合模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.3.7" data-path="../../设计模式/结构型模型/装饰模式.html">
            
                <a href="../../设计模式/结构型模型/装饰模式.html">
            
                    
                        <b>1.15.3.7.</b>
                    
                    装饰模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.3.8" data-path="../../设计模式/结构型模型/适配器模式.html">
            
                <a href="../../设计模式/结构型模型/适配器模式.html">
            
                    
                        <b>1.15.3.8.</b>
                    
                    适配器模式
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.15.4" data-path="../../设计模式/行为型模型/">
            
                <a href="../../设计模式/行为型模型/">
            
                    
                        <b>1.15.4.</b>
                    
                    行为型模型
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.15.4.1" data-path="../../设计模式/行为型模型/readme.html">
            
                <a href="../../设计模式/行为型模型/readme.html">
            
                    
                        <b>1.15.4.1.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.2" data-path="../../设计模式/行为型模型/中介者模式.html">
            
                <a href="../../设计模式/行为型模型/中介者模式.html">
            
                    
                        <b>1.15.4.2.</b>
                    
                    中介者模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.3" data-path="../../设计模式/行为型模型/命令模式.html">
            
                <a href="../../设计模式/行为型模型/命令模式.html">
            
                    
                        <b>1.15.4.3.</b>
                    
                    命令模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.4" data-path="../../设计模式/行为型模型/备忘录模式.html">
            
                <a href="../../设计模式/行为型模型/备忘录模式.html">
            
                    
                        <b>1.15.4.4.</b>
                    
                    备忘录模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.5" data-path="../../设计模式/行为型模型/模板方法模式.html">
            
                <a href="../../设计模式/行为型模型/模板方法模式.html">
            
                    
                        <b>1.15.4.5.</b>
                    
                    模板方法模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.6" data-path="../../设计模式/行为型模型/状态模式.html">
            
                <a href="../../设计模式/行为型模型/状态模式.html">
            
                    
                        <b>1.15.4.6.</b>
                    
                    状态模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.7" data-path="../../设计模式/行为型模型/策略模式.html">
            
                <a href="../../设计模式/行为型模型/策略模式.html">
            
                    
                        <b>1.15.4.7.</b>
                    
                    策略模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.8" data-path="../../设计模式/行为型模型/职责链模式.html">
            
                <a href="../../设计模式/行为型模型/职责链模式.html">
            
                    
                        <b>1.15.4.8.</b>
                    
                    职责链模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.9" data-path="../../设计模式/行为型模型/观察者模式.html">
            
                <a href="../../设计模式/行为型模型/观察者模式.html">
            
                    
                        <b>1.15.4.9.</b>
                    
                    观察者模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.10" data-path="../../设计模式/行为型模型/解释器模式.html">
            
                <a href="../../设计模式/行为型模型/解释器模式.html">
            
                    
                        <b>1.15.4.10.</b>
                    
                    解释器模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.11" data-path="../../设计模式/行为型模型/访问者模式.html">
            
                <a href="../../设计模式/行为型模型/访问者模式.html">
            
                    
                        <b>1.15.4.11.</b>
                    
                    访问者模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.12" data-path="../../设计模式/行为型模型/迭代器模式.html">
            
                <a href="../../设计模式/行为型模型/迭代器模式.html">
            
                    
                        <b>1.15.4.12.</b>
                    
                    迭代器模式
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../../.." >Copy</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <div id="anchor-navigation-ex-navbar"><i class="fa fa-anchor"></i><ul><li><a href="#go-clone&#xFF1A;&#x6781;&#x81F4;&#x4F18;&#x5316;&#x6DF1;&#x62F7;&#x8D1D;&#x6548;&#x7387;&#x4E0E;&#x62F7;&#x8D1D;&#x79C1;&#x6709;&#x5B57;&#x6BB5;">go-clone&#xFF1A;&#x6781;&#x81F4;&#x4F18;&#x5316;&#x6DF1;&#x62F7;&#x8D1D;&#x6548;&#x7387;&#x4E0E;&#x62F7;&#x8D1D;&#x79C1;&#x6709;&#x5B57;&#x6BB5;</a></li><ul><li><a href="#&#x5173;&#x4E8E;&#x63D0;&#x5347;&#x6DF1;&#x62F7;&#x8D1D;&#x6548;&#x7387;&#x7684;&#x601D;&#x8003;">&#x5173;&#x4E8E;&#x63D0;&#x5347;&#x6DF1;&#x62F7;&#x8D1D;&#x6548;&#x7387;&#x7684;&#x601D;&#x8003;</a></li><li><a href="#&#x6DF1;&#x62F7;&#x8D1D;&#x79C1;&#x6709;&#x5B57;&#x6BB5;">&#x6DF1;&#x62F7;&#x8D1D;&#x79C1;&#x6709;&#x5B57;&#x6BB5;</a></li><li><a href="#&#x51CF;&#x5C11;&#x53CD;&#x5C04;&#x4F7F;&#x7528;&#x7684;&#x6B21;&#x6570;">&#x51CF;&#x5C11;&#x53CD;&#x5C04;&#x4F7F;&#x7528;&#x7684;&#x6B21;&#x6570;</a></li><li><a href="#&#x5B9A;&#x4E49;&#x7279;&#x6B8A;&#x7684;&#x6570;&#x503C;&#x7C7B;&#x578B;&#x7ED3;&#x6784;&#x4F53;">&#x5B9A;&#x4E49;&#x7279;&#x6B8A;&#x7684;&#x6570;&#x503C;&#x7C7B;&#x578B;&#x7ED3;&#x6784;&#x4F53;</a></li><li><a href="#&#x62F7;&#x8D1D;&#x51FD;&#x6570;&#x6307;&#x9488;">&#x62F7;&#x8D1D;&#x51FD;&#x6570;&#x6307;&#x9488;</a></li><li><a href="#&#x5C0F;&#x7ED3;">&#x5C0F;&#x7ED3;</a></li></ul></ul></div><a href="#go-clone&#xFF1A;&#x6781;&#x81F4;&#x4F18;&#x5316;&#x6DF1;&#x62F7;&#x8D1D;&#x6548;&#x7387;&#x4E0E;&#x62F7;&#x8D1D;&#x79C1;&#x6709;&#x5B57;&#x6BB5;" id="anchorNavigationExGoTop"><i class="fa fa-arrow-up"></i></a><h1 id="go-clone&#xFF1A;&#x6781;&#x81F4;&#x4F18;&#x5316;&#x6DF1;&#x62F7;&#x8D1D;&#x6548;&#x7387;&#x4E0E;&#x62F7;&#x8D1D;&#x79C1;&#x6709;&#x5B57;&#x6BB5;"><a name="go-clone&#xFF1A;&#x6781;&#x81F4;&#x4F18;&#x5316;&#x6DF1;&#x62F7;&#x8D1D;&#x6548;&#x7387;&#x4E0E;&#x62F7;&#x8D1D;&#x79C1;&#x6709;&#x5B57;&#x6BB5;" class="anchor-navigation-ex-anchor" href="#go-clone&#xFF1A;&#x6781;&#x81F4;&#x4F18;&#x5316;&#x6DF1;&#x62F7;&#x8D1D;&#x6548;&#x7387;&#x4E0E;&#x62F7;&#x8D1D;&#x79C1;&#x6709;&#x5B57;&#x6BB5;"><i class="fa fa-link" aria-hidden="true"></i></a>go-clone&#xFF1A;&#x6781;&#x81F4;&#x4F18;&#x5316;&#x6DF1;&#x62F7;&#x8D1D;&#x6548;&#x7387;&#x4E0E;&#x62F7;&#x8D1D;&#x79C1;&#x6709;&#x5B57;&#x6BB5;</h1>
<h2 id="&#x5173;&#x4E8E;&#x63D0;&#x5347;&#x6DF1;&#x62F7;&#x8D1D;&#x6548;&#x7387;&#x7684;&#x601D;&#x8003;"><a name="&#x5173;&#x4E8E;&#x63D0;&#x5347;&#x6DF1;&#x62F7;&#x8D1D;&#x6548;&#x7387;&#x7684;&#x601D;&#x8003;" class="anchor-navigation-ex-anchor" href="#&#x5173;&#x4E8E;&#x63D0;&#x5347;&#x6DF1;&#x62F7;&#x8D1D;&#x6548;&#x7387;&#x7684;&#x601D;&#x8003;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x5173;&#x4E8E;&#x63D0;&#x5347;&#x6DF1;&#x62F7;&#x8D1D;&#x6548;&#x7387;&#x7684;&#x601D;&#x8003;</h2>
<p>&#x524D;&#x6587;&#x6240;&#x8BF4;&#x7684;&#x601D;&#x8DEF;&#x548C;&#x65B9;&#x6848;&#xFF0C;&#x5BF9;&#x4E8E;&#x719F;&#x6089;&#x53CD;&#x5C04;&#x7684;&#x5F00;&#x53D1;&#x8005;&#x6765;&#x8BF4;&#x975E;&#x5E38;&#x5BB9;&#x6613;&#x60F3;&#x5230;&#xFF0C;&#x5C5E;&#x4E8E;&#x5E38;&#x89C4;&#x89E3;&#x6CD5;&#x4E86;&#x3002;&#x4E0D;&#x8FC7;&#x6211;&#x4EEC;&#x90FD;&#x77E5;&#x9053;&#xFF0C;&#x53CD;&#x5C04;&#x7684;&#x6267;&#x884C;&#x6548;&#x7387;&#x6709;&#x9650;&#xFF0C;&#x5BF9;&#x4E8E;&#x5B57;&#x6BB5;&#x8F83;&#x591A;&#x7684;&#x7ED3;&#x6784;&#x6765;&#x8BF4;&#xFF0C;&#x6DF1;&#x62F7;&#x8D1D;&#x7684;&#x6548;&#x7387;&#x4F1A;&#x8FDC;&#x4F4E;&#x4E8E;&#x6D45;&#x62F7;&#x8D1D;&#x3002;&#x8003;&#x8651;&#x5230; Go &#x6570;&#x636E;&#x7ED3;&#x6784;&#x5E76;&#x4E0D;&#x5B58;&#x5728;&#x526F;&#x4F5C;&#x7528;&#xFF0C;&#x5BF9;&#x4E8E;&#x666E;&#x901A;&#x7684;&#x6570;&#x503C;&#x7C7B;&#x578B;&#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x6D45;&#x62F7;&#x8D1D;&#xFF0C;&#x5BF9;&#x4E8E;&#x6307;&#x9488;&#x3001;&#x63A5;&#x53E3;&#x3001;<code>map</code> &#x7B49;&#x7C7B;&#x578B;&#x4E5F;&#x53EF;&#x4EE5;&#x5148;&#x6D45;&#x62F7;&#x8D1D;&#x518D;&#x66FF;&#x6362;&#x6210;&#x65B0;&#x5185;&#x5BB9;&#xFF0C;&#x8FD9;&#x79CD;&#x62F7;&#x8D1D;&#x65B9;&#x6CD5;&#x4F1A;&#x6BD4;&#x901A;&#x8FC7;&#x53CD;&#x5C04;&#x6765;&#x62F7;&#x8D1D;&#x9AD8;&#x6548;&#x5F88;&#x591A;&#x3002;</p>
<p>&#x8003;&#x8651;&#x4EE5;&#x4E0B;&#x6570;&#x636E;&#x7ED3;&#x6784;&#x3002;</p>
<pre class="language-"><code class="lang-go"><span class="token keyword">type</span> T1 <span class="token keyword">struct</span> <span class="token punctuation">{</span>
    A <span class="token builtin">int</span>
    B <span class="token builtin">string</span>
    C <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token builtin">float64</span>
    d <span class="token builtin">uint</span>
<span class="token punctuation">}</span>
</code></pre>
<p>&#x5982;&#x679C;&#x6211;&#x4EEC;&#x624B;&#x52A8;&#x8FDB;&#x884C;&#x6DF1;&#x62F7;&#x8D1D;&#xFF0C;&#x6700;&#x9AD8;&#x6548;&#x7684;&#x65B9;&#x6CD5;&#x5982;&#x4E0B;&#x6240;&#x793A;&#xFF1A;</p>
<pre class="language-"><code class="lang-go">t <span class="token operator">:=</span> <span class="token operator">&amp;</span>T1<span class="token punctuation">{</span>
    A<span class="token punctuation">:</span> <span class="token number">123</span><span class="token punctuation">,</span>
    B<span class="token punctuation">:</span> <span class="token string">&quot;test&quot;</span><span class="token punctuation">,</span>
    C<span class="token punctuation">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token builtin">float64</span><span class="token punctuation">{</span><span class="token number">1.2</span><span class="token punctuation">,</span> <span class="token number">3.4</span><span class="token punctuation">}</span><span class="token punctuation">,</span>
    d<span class="token punctuation">:</span> <span class="token number">321</span><span class="token punctuation">,</span>
<span class="token punctuation">}</span>

<span class="token keyword">var</span> cloned T1
cloned <span class="token operator">=</span> <span class="token operator">*</span>t                          <span class="token comment">// &#x5148;&#x505A;&#x4E00;&#x6B21;&#x6D45;&#x62F7;&#x8D1D;&#x3002;</span>
cloned<span class="token punctuation">.</span>C <span class="token operator">=</span> <span class="token function">make</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token builtin">float64</span><span class="token punctuation">,</span> <span class="token function">len</span><span class="token punctuation">(</span>t<span class="token punctuation">.</span>C<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token comment">// &#x7533;&#x8BF7;&#x65B0;&#x7684;&#x5185;&#x5B58;&#x7A7A;&#x95F4;&#x3002;</span>
<span class="token function">copy</span><span class="token punctuation">(</span>cloned<span class="token punctuation">.</span>T<span class="token punctuation">,</span> t<span class="token punctuation">.</span>C<span class="token punctuation">)</span>                  <span class="token comment">// &#x5C06; t.C &#x5185;&#x5BB9;&#x62F7;&#x8D1D;&#x8FC7;&#x6765;&#x3002;</span>
</code></pre>
<p>&#x8FD9;&#x91CC;&#x9700;&#x8981;&#x6CE8;&#x610F;&#xFF0C;<code>B string</code> &#x662F;&#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x6D45;&#x62F7;&#x8D1D;&#x7684;&#xFF0C;&#x5728; Go &#x91CC;&#x9762;&#x7EA6;&#x5B9A; <code>string</code> &#x662F;&#x4E0D;&#x53EF;&#x53D8;&#xFF08;immutable&#xFF09;&#x7684;&#xFF0C;&#x5176;&#x4E2D;&#x5F15;&#x7528;&#x7684;&#x5B57;&#x7B26;&#x4E32;&#x4E0D;&#x4F1A;&#x88AB;&#x8F7B;&#x6613;&#x4FEE;&#x6539;&#xFF0C;&#x751A;&#x81F3;&#x5B57;&#x9762;&#x5E38;&#x91CF;&#x90FD;&#x653E;&#x5728;&#x4E86;&#x53EA;&#x8BFB;&#x7684;&#x5185;&#x5B58;&#x7A7A;&#x95F4;&#x4E2D;&#x6765;&#x786E;&#x4FDD;&#x771F;&#x6B63;&#x7684;&#x4E0D;&#x53EF;&#x53D8;&#x3002;</p>
<h2 id="&#x6DF1;&#x62F7;&#x8D1D;&#x79C1;&#x6709;&#x5B57;&#x6BB5;"><a name="&#x6DF1;&#x62F7;&#x8D1D;&#x79C1;&#x6709;&#x5B57;&#x6BB5;" class="anchor-navigation-ex-anchor" href="#&#x6DF1;&#x62F7;&#x8D1D;&#x79C1;&#x6709;&#x5B57;&#x6BB5;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x6DF1;&#x62F7;&#x8D1D;&#x79C1;&#x6709;&#x5B57;&#x6BB5;</h2>
<p>&#x5728;&#x8FD9;&#x4E2A;&#x4F8B;&#x5B50;&#x91CC;&#x9762;&#x6697;&#x542B;&#x4E86;&#x4E00;&#x4E2A;&#x300C;&#x5F69;&#x86CB;&#x300D;&#xFF1A;&#x672C;&#x6765;&#x4E0D;&#x53EF;&#x89C1;&#x7684;&#x79C1;&#x6709;&#x5B57;&#x6BB5;&#xFF08;unexported field&#xFF09;<code>d</code> &#x4E5F;&#x88AB;&#x300C;&#x987A;&#x4FBF;&#x300D;&#x6DF1;&#x62F7;&#x8D1D;&#x4E86;&#x3002;</p>
<p>&#x5982;&#x679C;&#x6309;&#x7167;&#x53CD;&#x5C04;&#x7684;&#x65B9;&#x6CD5;&#xFF0C;&#x6240;&#x6709;&#x79C1;&#x6709;&#x5B57;&#x6BB5;&#x90FD;&#x4E0D;&#x53EF;&#x5199;&#xFF08;&#x79C1;&#x6709;&#x5B57;&#x6BB5;&#x7684; <code>reflect.Value</code> &#x4E2D; <code>CanSet</code> &#x65B9;&#x6CD5;&#x59CB;&#x7EC8;&#x8FD4;&#x56DE; <code>false</code>&#xFF09;&#xFF0C; &#x4ECE;&#x800C;&#x4E5F;&#x4E0D;&#x80FD;&#x5728;&#x6DF1;&#x62F7;&#x8D1D;&#x7684;&#x65F6;&#x5019;&#x5199;&#x5165;&#x6570;&#x636E;&#xFF0C;&#x4F46;&#x73B0;&#x5728;&#x4F7F;&#x7528;&#x8FD9;&#x79CD;&#x5148;&#x6D45;&#x62F7;&#x8D1D;&#x518D;&#x6DF1;&#x62F7;&#x8D1D;&#x7684;&#x65B9;&#x6CD5;&#x4F1A;&#x9020;&#x6210;&#x79C1;&#x6709;&#x5B57;&#x6BB5;&#x4E5F;&#x88AB;&#x62F7;&#x8D1D;&#xFF0C;&#x5047;&#x8BBE;&#x5176;&#x4E2D;&#x5305;&#x542B;&#x6307;&#x9488;&#x4E4B;&#x7C7B;&#x7C7B;&#x578B;&#xFF0C;&#x90A3;&#x4E48;&#x8FD9;&#x4E2A;&#x6307;&#x9488;&#x5C31;&#x4F1A;&#x8FD8;&#x6307;&#x5411;&#x8001;&#x7684;&#x6570;&#x636E;&#x7ED3;&#x6784;&#xFF0C;&#x5E76;&#x6CA1;&#x6709;&#x771F;&#x6B63;&#x8FBE;&#x6210;&#x6DF1;&#x62F7;&#x8D1D;&#x7684;&#x76EE;&#x6807;&#xFF0C;&#x4F1A;&#x9020;&#x6210;&#x6F5C;&#x5728;&#x7684;&#x95EE;&#x9898;&#x3002;</p>
<p>&#x60F3;&#x8981;&#x63D0;&#x5347;&#x62F7;&#x8D1D;&#x6548;&#x7387;&#xFF0C;&#x5C31;&#x5F97;&#x8003;&#x8651;&#x600E;&#x4E48;&#x6837;&#x624D;&#x80FD;&#x5B8C;&#x7F8E;&#x7684;&#x62F7;&#x8D1D;&#x6240;&#x6709;&#x79C1;&#x6709;&#x5B57;&#x6BB5;&#x624D;&#x884C;&#xFF0C;&#x8981;&#x60F3;&#x505A;&#x5230;&#x8FD9;&#x70B9;&#x5C31;&#x5F97;&#x4E86;&#x89E3; Go &#x6570;&#x636E;&#x7ED3;&#x6784;&#x7684;&#x5185;&#x5B58;&#x5E03;&#x5C40;&#x7EC6;&#x8282;&#x3002;</p>
<p>Go &#x4E3A;&#x4E86;&#x80FD;&#x65B9;&#x4FBF;&#x7684;&#x4E0E;&#x5E95;&#x5C42;&#x7CFB;&#x7EDF;&#x8FDB;&#x884C;&#x4E92;&#x64CD;&#x4F5C;&#xFF0C;&#x5728;&#x6570;&#x636E;&#x7ED3;&#x6784;&#x7684;&#x5185;&#x5B58;&#x5E03;&#x5C40;&#x65B9;&#x9762;&#x4FDD;&#x6301;&#x4E86;&#x975E;&#x5E38;&#x4E25;&#x683C;&#x7684;&#x987A;&#x5E8F;&#x6027;&#xFF0C;&#x4F7F;&#x5F97;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x6709;&#x673A;&#x4F1A;&#x76F4;&#x63A5;&#x901A;&#x8FC7;&#x504F;&#x79FB;&#x91CF;&#x6765;&#x5F97;&#x77E5;&#x6BCF;&#x4E2A;&#x5B57;&#x6BB5;&#xFF0C;&#x5305;&#x62EC;&#x79C1;&#x6709;&#x5B57;&#x6BB5;&#xFF0C;&#x5728;&#x5185;&#x5B58;&#x4E2D;&#x7684;&#x771F;&#x5B9E;&#x4F4D;&#x7F6E;&#xFF0C;&#x501F;&#x52A9; <code>unsafe</code> &#x5E93;&#x63D0;&#x4F9B;&#x7684;&#x4E0D;&#x5B89;&#x5168;&#x5185;&#x5B58;&#x8BBF;&#x95EE;&#x7684;&#x80FD;&#x529B;&#x5C31;&#x53EF;&#x4EE5;&#x4FEE;&#x6539;&#x4EFB;&#x610F;&#x7684;&#x79C1;&#x6709;&#x5B57;&#x6BB5;&#x3002;</p>
<p>&#x4E0B;&#x9762;&#x8FD9;&#x4E2A;&#x4F8B;&#x5B50;&#x5C55;&#x793A;&#x4E86;&#x5982;&#x4F55;&#x7EAF;&#x7CB9;&#x901A;&#x8FC7; <code>reflect</code> &#x548C; <code>unsafe</code> &#x6765;&#x6DF1;&#x62F7;&#x8D1D;&#x4E00;&#x4E2A;&#x79C1;&#x6709;&#x5B57;&#x6BB5;&#x7684;&#x6307;&#x9488;&#x3002;</p>
<pre class="language-"><code class="lang-go"><span class="token keyword">type</span> T2 <span class="token keyword">struct</span> <span class="token punctuation">{</span>
    A <span class="token builtin">int</span>
    p <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token builtin">int</span>
<span class="token punctuation">}</span>

t <span class="token operator">:=</span> <span class="token operator">&amp;</span>T2<span class="token punctuation">{</span>
    A<span class="token punctuation">:</span> <span class="token number">123</span><span class="token punctuation">,</span>
    p<span class="token punctuation">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token builtin">int</span><span class="token punctuation">{</span><span class="token number">1</span><span class="token punctuation">}</span><span class="token punctuation">,</span>
<span class="token punctuation">}</span>

tt <span class="token operator">:=</span> reflect<span class="token punctuation">.</span><span class="token function">TypeOf</span><span class="token punctuation">(</span>t<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">Elem</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token comment">// &#x62FF;&#x5230;&#x7C7B;&#x578B; T&#x3002;</span>
fieldP <span class="token operator">:=</span> tt<span class="token punctuation">.</span><span class="token function">FieldByName</span><span class="token punctuation">(</span><span class="token string">&quot;p&quot;</span><span class="token punctuation">)</span>  <span class="token comment">// &#x62FF;&#x5230; p &#x7684;&#x5B57;&#x6BB5;&#x4FE1;&#x606F;&#x3002;</span>

tv <span class="token operator">:=</span> reflect<span class="token punctuation">.</span><span class="token function">ValueOf</span><span class="token punctuation">(</span>t<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">Elem</span><span class="token punctuation">(</span><span class="token punctuation">)</span>    <span class="token comment">// &#x62FF;&#x5230; t &#x7684;&#x53CD;&#x5C04;&#x503C;&#x3002;</span>
p <span class="token operator">:=</span> tv<span class="token punctuation">.</span><span class="token function">FieldByIndex</span><span class="token punctuation">(</span>fieldP<span class="token punctuation">.</span>Index<span class="token punctuation">)</span> <span class="token comment">// &#x62FF;&#x5230; t.p &#x7684;&#x53CD;&#x5C04;&#x503C;&#xFF0C;&#x867D;&#x7136;&#x4E0D;&#x8BA9;&#x5199;&#xFF0C;&#x4F46;&#x662F;&#x53EF;&#x4EE5;&#x8BFB;&#x3002;</span>

num <span class="token operator">:=</span> p<span class="token punctuation">.</span><span class="token function">Len</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
c <span class="token operator">:=</span> p<span class="token punctuation">.</span><span class="token function">Cap</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
clonedP <span class="token operator">:=</span> reflect<span class="token punctuation">.</span><span class="token function">MakeSlice</span><span class="token punctuation">(</span>fieldP<span class="token punctuation">.</span>Type<span class="token punctuation">,</span> num<span class="token punctuation">,</span> c<span class="token punctuation">)</span> <span class="token comment">// &#x6784;&#x9020;&#x4E00;&#x4E2A;&#x65B0;&#x7684; slice&#x3002;</span>
src <span class="token operator">:=</span> unsafe<span class="token punctuation">.</span><span class="token function">Pointer</span><span class="token punctuation">(</span>p<span class="token punctuation">.</span><span class="token function">Pointer</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>       <span class="token comment">// &#x62FF;&#x5230; p &#x6570;&#x636E;&#x6307;&#x9488;&#x3002;</span>
dst <span class="token operator">:=</span> unsafe<span class="token punctuation">.</span><span class="token function">Pointer</span><span class="token punctuation">(</span>clonedP<span class="token punctuation">.</span><span class="token function">Pointer</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token comment">// &#x62FF;&#x5230; clonedP &#x6570;&#x636E;&#x6307;&#x9488;&#x3002;</span>
sz <span class="token operator">:=</span> <span class="token function">int</span><span class="token punctuation">(</span>p<span class="token punctuation">.</span><span class="token function">Type</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">Elem</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">Size</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>        <span class="token comment">// &#x8BA1;&#x7B97;&#x51FA; []int &#x5355;&#x4E2A;&#x6570;&#x7EC4;&#x5143;&#x7D20;&#x7684;&#x957F;&#x5EA6;&#xFF0C;&#x5373; int &#x7684;&#x957F;&#x5EA6;&#x3002;</span>
l <span class="token operator">:=</span> num <span class="token operator">*</span> sz                            <span class="token comment">// &#x5F97;&#x5230; p &#x7684;&#x6570;&#x636E;&#x771F;&#x5B9E;&#x5185;&#x5B58;&#x5B57;&#x8282;&#x6570;&#x3002;</span>
cc <span class="token operator">:=</span> c <span class="token operator">*</span> sz                             <span class="token comment">// &#x5F97;&#x5230; p &#x7684; cap &#x771F;&#x5B9E;&#x5185;&#x5B58;&#x5B57;&#x8282;&#x6570;&#x3002;</span>

<span class="token comment">// &#x76F4;&#x63A5;&#x65E0;&#x89C6;&#x7C7B;&#x578B;&#x8FDB;&#x884C;&#x5185;&#x5B58;&#x62F7;&#x8D1D;&#xFF0C;&#x76F8;&#x5F53;&#x4E8E; C &#x8BED;&#x8A00;&#x91CC;&#x9762;&#x7684; memcpy&#x3002;</span>
<span class="token function">copy</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token operator">*</span><span class="token punctuation">[</span>math<span class="token punctuation">.</span>MaxInt32<span class="token punctuation">]</span><span class="token builtin">byte</span><span class="token punctuation">)</span><span class="token punctuation">(</span>dst<span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token punctuation">:</span>l<span class="token punctuation">:</span>cc<span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token operator">*</span><span class="token punctuation">[</span>math<span class="token punctuation">.</span>MaxInt32<span class="token punctuation">]</span><span class="token builtin">byte</span><span class="token punctuation">)</span><span class="token punctuation">(</span>src<span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token punctuation">:</span>l<span class="token punctuation">:</span>cc<span class="token punctuation">]</span><span class="token punctuation">)</span>

<span class="token keyword">var</span> cloned T2
cloned <span class="token operator">=</span> <span class="token operator">*</span>t <span class="token comment">// &#x5148;&#x505A;&#x4E00;&#x6B21;&#x6D45;&#x62F7;&#x8D1D;&#x3002;</span>
ptr <span class="token operator">:=</span> unsafe<span class="token punctuation">.</span><span class="token function">Pointer</span><span class="token punctuation">(</span><span class="token function">uintptr</span><span class="token punctuation">(</span>unsafe<span class="token punctuation">.</span><span class="token function">Pointer</span><span class="token punctuation">(</span><span class="token operator">&amp;</span>cloned<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token operator">+</span> fieldP<span class="token punctuation">.</span>Offset<span class="token punctuation">)</span> <span class="token comment">// &#x62FF;&#x5230; p &#x7684;&#x771F;&#x5B9E;&#x5185;&#x5B58;&#x4F4D;&#x7F6E;&#x3002;</span>

<span class="token comment">// &#x8FD9;&#x91CC;&#x5DF2;&#x77E5; p &#x662F;&#x4E00;&#x4E2A; slice&#xFF0C;&#x7528; `SliceHeader` &#x8FDB;&#x884C;&#x5F3A;&#x5236;&#x62F7;&#x8D1D;&#xFF0C;&#x76F8;&#x5F53;&#x4E8E;&#x505A;&#x4E86; cloned.p = clonedP&#x3002;</span>
<span class="token operator">*</span><span class="token punctuation">(</span><span class="token operator">*</span>reflect<span class="token punctuation">.</span>SliceHeader<span class="token punctuation">)</span><span class="token punctuation">(</span>p<span class="token punctuation">)</span> <span class="token operator">=</span> reflect<span class="token punctuation">.</span>SliceHeader<span class="token punctuation">{</span>
    Data<span class="token punctuation">:</span> dst<span class="token punctuation">,</span>
    Len<span class="token punctuation">:</span>  num<span class="token punctuation">,</span>
    Cap<span class="token punctuation">:</span>  c<span class="token punctuation">,</span>
<span class="token punctuation">}</span>
</code></pre>
<p>&#x5F88;&#x663E;&#x7136;&#x4E0A;&#x9762;&#x8FD9;&#x6BB5;&#x4EE3;&#x7801;&#x975E;&#x5E38;&#x7684;&#x6298;&#x817E;&#xFF0C;&#x6D89;&#x53CA;&#x4E0D;&#x5C11; Go runtime &#x5C42;&#x9762;&#x4E0A;&#x7684;&#x6982;&#x5FF5;&#x548C;&#x6280;&#x5DE7;&#xFF0C;&#x6211;&#x4EEC;&#x6765;&#x9010;&#x6BB5;&#x4ED4;&#x7EC6;&#x770B;&#x4E00;&#x4E0B;&#x3002;&#x4E3A;&#x4E86;&#x65B9;&#x4FBF;&#x53D9;&#x8FF0;&#xFF0C;&#x4E0A;&#x9762;&#x7684;&#x4EE3;&#x7801;&#x91CC;&#x76F4;&#x63A5;&#x5047;&#x5B9A;&#x6211;&#x4EEC;&#x5DF2;&#x7ECF;&#x77E5;&#x9053; p &#x662F;&#x4E2A; []int&#xFF0C;&#x8FD9;&#x6837;&#x5C31;&#x4E0D;&#x7528;&#x5199;&#x5927;&#x91CF; switch...case &#x5224;&#x65AD; Kind&#xFF0C;&#x8BA9;&#x672C;&#x6765;&#x5C31;&#x633A;&#x96BE;&#x7406;&#x89E3;&#x7684;&#x4EE3;&#x7801;&#x53D8;&#x5F97;&#x66F4;&#x96BE;&#x8BFB;&#x4E86;&#x3002;&#x5982;&#x679C;&#x5E0C;&#x671B;&#x770B;&#x5230;&#x5B8C;&#x6574;&#x7684;&#x7C7B;&#x578B;&#x5224;&#x65AD;&#x903B;&#x8F91;&#xFF0C;&#x53EF;&#x4EE5;&#x53C2;&#x8003;&#x6E90;&#x7801; <a href="https://link.zhihu.com/?target=https%3A//github.com/huandu/go-clone/blob/v1.1.2/clone.go%23L291" target="_blank">https://github.com/huandu/go-clone/blob/v1.1.2/clone.go#L291</a>&#x3002;</p>
<p>&#x9996;&#x5148;&#xFF0C;&#x80FD;&#x62F7;&#x8D1D;&#x79C1;&#x6709;&#x5B57;&#x6BB5;&#x7684;&#x524D;&#x63D0;&#x662F;&#xFF0C;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x901A;&#x8FC7; <code>reflect</code> &#x5E93;&#x8BFB;&#x5230;&#x79C1;&#x6709;&#x5B57;&#x6BB5;&#x7684;&#x7C7B;&#x578B;&#x5B9A;&#x4E49;&#x548C;&#x6570;&#x636E;&#xFF0C;&#x53EA;&#x8BFB;&#x4E0D;&#x80FD;&#x5199;&#xFF0C;&#x5047;&#x5982;&#x8BFB;&#x90FD;&#x8BFB;&#x4E0D;&#x5230;&#xFF0C;&#x90A3;&#x5C31;&#x4E00;&#x70B9;&#x529E;&#x6CD5;&#x90FD;&#x6CA1;&#x6709;&#x4E86;&#x3002;</p>
<p>&#x5176;&#x6B21;&#xFF0C;&#x5728;&#x62FF;&#x5230;&#x5B57;&#x6BB5; <code>p</code> &#x7684;&#x7C7B;&#x578B;&#x4FE1;&#x606F; <code>fieldP</code> &#x4E4B;&#x540E;&#xFF0C;&#x6211;&#x4EEC;&#x5C31;&#x53EF;&#x4EE5;&#x8F7B;&#x677E;&#x901A;&#x8FC7; <code>field.Type</code> &#x5F97;&#x77E5; <code>p</code> &#x7684;&#x7C7B;&#x578B;&#xFF0C;&#x4ECE;&#x800C;&#x53EF;&#x4EE5;&#x901A;&#x8FC7; <code>Kind</code> &#x6765;&#x533A;&#x5206;&#x4E0D;&#x540C;&#x7C7B;&#x578B;&#x7684;&#x4E0D;&#x540C;&#x4EE3;&#x7801;&#x903B;&#x8F91;&#x3002;&#x5728; <code>fieldP</code> &#x91CC;&#x9762;&#x6709;&#x4E2A;&#x975E;&#x5E38;&#x5173;&#x952E;&#x70B9;&#x5B57;&#x6BB5; <code>fieldP.Offset</code>&#xFF0C;&#x5B83;&#x8868;&#x793A; <code>p</code> &#x76F8;&#x5BF9;&#x7ED3;&#x6784;&#x6307;&#x9488;&#x7684;&#x5934;&#x90E8;&#x7684;&#x504F;&#x79FB;&#x91CF;&#x3002;</p>
<p>&#x4E0B;&#x9762;&#x8FD9;&#x4E2A;&#x7B49;&#x5F0F;&#x662F;&#x59CB;&#x7EC8;&#x6B63;&#x786E;&#x7684;&#x3002;</p>
<pre class="language-"><code class="lang-go">unsafe<span class="token punctuation">.</span><span class="token function">Pointer</span><span class="token punctuation">(</span><span class="token operator">&amp;</span>t<span class="token punctuation">.</span>p<span class="token punctuation">)</span> <span class="token operator">==</span> unsafe<span class="token punctuation">.</span><span class="token function">Pointer</span><span class="token punctuation">(</span><span class="token function">uintptr</span><span class="token punctuation">(</span>unsafe<span class="token punctuation">.</span><span class="token function">Pointer</span><span class="token punctuation">(</span>t<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token operator">+</span> fieldP<span class="token punctuation">.</span>Offset<span class="token punctuation">)</span>
</code></pre>
<p>&#x77E5;&#x9053; <code>p</code> &#x771F;&#x5B9E;&#x5185;&#x5B58;&#x4F4D;&#x7F6E;&#x4E4B;&#x540E;&#x5C31;&#x80FD;&#x505A;&#x5F88;&#x591A;&#x4E8B;&#x60C5;&#x4E86;&#xFF0C;&#x6BD4;&#x5982;&#x76F4;&#x63A5;&#x8FDB;&#x884C;&#x5185;&#x5B58;&#x62F7;&#x8D1D;&#x3002;&#x540C;&#x7406;&#xFF0C;&#x7531;&#x4E8E; slice &#x6570;&#x636E;&#x7684;&#x5185;&#x5B58;&#x662F;&#x8FDE;&#x7EED;&#x7684;&#xFF0C;&#x4E00;&#x65E6;&#x77E5;&#x9053;&#x4E86;&#x771F;&#x5B9E;&#x7684;&#x5185;&#x5B58;&#x5730;&#x5740;&#x4E4B;&#x540E;&#x4E5F;&#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x8FDB;&#x884C;&#x6570;&#x636E;&#x62F7;&#x8D1D;&#xFF0C;&#x5B8C;&#x6210; slice &#x5185;&#x5BB9;&#x7684;&#x590D;&#x5236;&#x3002;</p>
<p>&#x5177;&#x4F53;&#x5185;&#x5B58;&#x62F7;&#x8D1D;&#x7684;&#x65B9;&#x6CD5;&#x5C31;&#x662F;&#x4E0B;&#x9762;&#x8FD9;&#x6BB5;&#x4EE3;&#x7801;&#x3002;</p>
<pre class="language-"><code class="lang-go"><span class="token function">copy</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token operator">*</span><span class="token punctuation">[</span>math<span class="token punctuation">.</span>MaxInt32<span class="token punctuation">]</span><span class="token builtin">byte</span><span class="token punctuation">)</span><span class="token punctuation">(</span>dst<span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token punctuation">:</span>l<span class="token punctuation">:</span>cc<span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token operator">*</span><span class="token punctuation">[</span>math<span class="token punctuation">.</span>MaxInt32<span class="token punctuation">]</span><span class="token builtin">byte</span><span class="token punctuation">)</span><span class="token punctuation">(</span>src<span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token punctuation">:</span>l<span class="token punctuation">:</span>cc<span class="token punctuation">]</span><span class="token punctuation">)</span>
</code></pre>
<p>&#x5B83;&#x7684;&#x539F;&#x7406;&#x662F;&#xFF1A;&#x5148;&#x5C06; <code>dst</code> &#x548C; <code>src</code> &#x8FD9;&#x6837;&#x7684; <code>unsafe.Pointer</code> &#x5F3A;&#x5236;&#x8F6C;&#x6210; <code>[math.MaxInt32]byte</code> &#x7C7B;&#x578B;&#xFF0C;&#x7136;&#x540E;&#x518D;&#x5BF9;&#x8FD9;&#x4E2A;&#x4F2A;&#x88C5;&#x7684;&#x6570;&#x7EC4;&#x8FDB;&#x884C; slice &#x64CD;&#x4F5C;&#xFF0C;&#x5C06;&#x8981;&#x62F7;&#x8D1D;&#x7684;&#x5185;&#x5BB9;&#x5207;&#x51FA;&#x6765;&#x751F;&#x6210;&#x5408;&#x6CD5;&#x7684; <code>[]byte</code>&#xFF0C;&#x6700;&#x540E;&#x4EA4;&#x7ED9; <code>copy</code> &#x6765;&#x62F7;&#x8D1D;&#x6570;&#x636E;&#x3002;</p>
<p>&#x6700;&#x540E;&#xFF0C;&#x8FD8;&#x9700;&#x8981;&#x6CE8;&#x610F; slice &#x7ED3;&#x6784;&#x672C;&#x8EAB;&#x5E76;&#x4E0D;&#x662F;&#x4E00;&#x4E2A;&#x6307;&#x9488;&#xFF0C;&#x800C;&#x662F;&#x5305;&#x542B;&#x4E86;&#x51E0;&#x4E2A;&#x5B57;&#x6BB5;&#x7684;&#x7ED3;&#x6784;&#xFF0C;&#x5177;&#x4F53;&#x5B9A;&#x4E49;&#x653E;&#x5728; <code>reflect.SliceHeader</code> &#x8FD9;&#x91CC;&#x3002;</p>
<h2 id="&#x51CF;&#x5C11;&#x53CD;&#x5C04;&#x4F7F;&#x7528;&#x7684;&#x6B21;&#x6570;"><a name="&#x51CF;&#x5C11;&#x53CD;&#x5C04;&#x4F7F;&#x7528;&#x7684;&#x6B21;&#x6570;" class="anchor-navigation-ex-anchor" href="#&#x51CF;&#x5C11;&#x53CD;&#x5C04;&#x4F7F;&#x7528;&#x7684;&#x6B21;&#x6570;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x51CF;&#x5C11;&#x53CD;&#x5C04;&#x4F7F;&#x7528;&#x7684;&#x6B21;&#x6570;</h2>
<p>&#x53CD;&#x5C04;&#x4F7F;&#x7528;&#x8FC7;&#x591A;&#x5C31;&#x5F71;&#x54CD;&#x6548;&#x7387;&#xFF0C;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x770B;&#x5230;&#xFF0C;&#x4E1A;&#x52A1;&#x4E2D;&#x5927;&#x591A;&#x6570; Go &#x6570;&#x636E;&#x7ED3;&#x6784;&#x7684;&#x5B57;&#x6BB5;&#x7C7B;&#x578B;&#x90FD;&#x662F;&#x6570;&#x503C;&#x7C7B;&#x578B;&#xFF08;&#x6BD4;&#x5982;&#x5404;&#x79CD; int&#x3001;float &#x7B49;&#xFF09;&#xFF0C;&#x7279;&#x522B;&#x662F;&#x90A3;&#x4E9B;&#x53EA;&#x5305;&#x542B;&#x6570;&#x503C;&#x7C7B;&#x578B;&#x7684; Go &#x6570;&#x636E;&#x7ED3;&#x6784;&#xFF0C;&#x7B80;&#x5355;&#x7684;&#x505A;&#x4E00;&#x6B21;&#x6D45;&#x62F7;&#x8D1D;&#x5C31;&#x80FD;&#x5B8C;&#x6210;&#x6240;&#x6709;&#x5DE5;&#x4F5C;&#xFF0C;&#x8FD9;&#x6837;&#x5904;&#x7406;&#x80AF;&#x5B9A;&#x6BD4;&#x6BCF;&#x6B21;&#x90FD;&#x7528; <code>reflect</code> &#x904D;&#x5386;&#x6240;&#x6709;&#x5B57;&#x6BB5;&#x8FDB;&#x884C;&#x9010;&#x4E00;&#x62F7;&#x8D1D;&#x6765;&#x5F97;&#x5FEB;&#x5F88;&#x591A;&#x3002;</p>
<p>&#x53EF;&#x4EE5;&#x60F3;&#x5230;&#xFF0C;&#x5982;&#x679C;&#x80FD;&#x9884;&#x5148;&#x7F13;&#x5B58;&#x7C7B;&#x578B;&#x4FE1;&#x606F;&#xFF0C;&#x4EC5;&#x4EC5;&#x6807;&#x8BB0;&#x51FA;&#x7C7B;&#x578B;&#x4E2D;&#x5FC5;&#x987B;&#x8FDB;&#x884C;&#x6DF1;&#x62F7;&#x8D1D;&#x7684;&#x5B57;&#x6BB5;&#x5C31;&#x597D;&#x4E86;&#xFF0C;&#x8FD9;&#x6837;&#x6BCF;&#x4E2A;&#x7C7B;&#x578B;&#x81F3;&#x591A;&#x53EA;&#x505A;&#x4E00;&#x6B21;&#x53CD;&#x5C04;&#xFF0C;&#x5269;&#x4E0B;&#x7684;&#x62F7;&#x8D1D;&#x5C31;&#x53EF;&#x4EE5;&#x5B8C;&#x5168;&#x4EA4;&#x7ED9;&#x5404;&#x79CD; <code>unsafe</code> &#x5185;&#x5B58;&#x64CD;&#x4F5C;&#x5C31;&#x597D;&#x4E86;&#x3002;</p>
<p>&#x5728;&#x5F53;&#x524D;&#x5B9E;&#x73B0;&#x4E2D;&#xFF0C;&#x6211;&#x4EEC;&#x5B9A;&#x4E49;&#x4E86;&#x4E00;&#x4E2A;&#x7C7B;&#x578B; <code>type structType</code>&#xFF0C;&#x7528;&#x4E8E;&#x8BB0;&#x5F55;&#x7ED3;&#x6784;&#x91CC;&#x9762;&#x9700;&#x8981;&#x8FDB;&#x884C;&#x6DF1;&#x62F7;&#x8D1D;&#x7684;&#x5B57;&#x6BB5;&#x4FE1;&#x606F;&#xFF0C;&#x6CA1;&#x6709;&#x8BB0;&#x5F55;&#x5728;&#x5185;&#x7684;&#x5B57;&#x6BB5;&#x4FE1;&#x606F;&#x5C31;&#x662F;&#x53EF;&#x4EE5;&#x6D45;&#x62F7;&#x8D1D;&#x7684;&#x6570;&#x503C;&#x5B57;&#x6BB5;&#x3002;</p>
<pre class="language-"><code class="lang-go"><span class="token keyword">type</span> structType <span class="token keyword">struct</span> <span class="token punctuation">{</span>
    PointerFields <span class="token punctuation">[</span><span class="token punctuation">]</span>structFieldType
<span class="token punctuation">}</span>

<span class="token keyword">type</span> structFieldType <span class="token keyword">struct</span> <span class="token punctuation">{</span>
    Offset <span class="token builtin">uintptr</span> <span class="token comment">// The offset from the beginning of the struct.</span>
    Index  <span class="token builtin">int</span>     <span class="token comment">// The index of the field.</span>
<span class="token punctuation">}</span>
</code></pre>
<p>&#x5177;&#x4F53;&#x751F;&#x6210;&#x8FD9;&#x4E2A;&#x7C7B;&#x578B;&#x6570;&#x636E;&#x7684;&#x4EE3;&#x7801;&#x653E;&#x5728; <a href="https://link.zhihu.com/?target=https%3A//github.com/huandu/go-clone/blob/v1.1.2/structtype.go%23L51" target="_blank">https://github.com/huandu/go-clone/blob/v1.1.2/structtype.go#L51</a> &#x8FD9;&#x91CC;&#xFF0C;&#x601D;&#x8DEF;&#x6BD4;&#x8F83;&#x7B80;&#x5355;&#x76F4;&#x63A5;&#xFF1A;&#x904D;&#x5386;&#x7ED3;&#x6784;&#x7684;&#x6BCF;&#x4E2A;&#x5B57;&#x6BB5;&#xFF0C;&#x5224;&#x65AD;&#x662F;&#x5426;&#x662F;&#x6570;&#x503C;&#x7C7B;&#x578B;&#xFF0C;&#x5982;&#x679C;&#x4E0D;&#x662F;&#xFF0C;&#x751F;&#x6210; <code>structFieldType</code> &#x5E76;&#x653E;&#x5165;&#x5230; <code>structType</code> &#x7684; <code>PointerFields</code> &#x91CC;&#x9762;&#x3002;</p>
<p>&#x7531;&#x4E8E; Go &#x6570;&#x636E;&#x7ED3;&#x6784;&#x7684;&#x7C7B;&#x578B;&#x5B9A;&#x4E49;&#x4E0D;&#x4F1A;&#x5728;&#x8FD0;&#x884C;&#x65F6;&#x8FDB;&#x884C;&#x4FEE;&#x6539;&#xFF0C;&#x4E3A;&#x4E86;&#x907F;&#x514D;&#x7ECF;&#x5E38;&#x91CD;&#x590D;&#x7684;&#x5206;&#x6790;&#x4E00;&#x4E2A;&#x7C7B;&#x578B;&#xFF0C;&#x5B9E;&#x9645;&#x4E2D;&#x6211;&#x4EEC;&#x7528;&#x4E86;&#x4E00;&#x4E2A; <code>sync.Map</code> &#x7C7B;&#x578B;&#x7684;&#x5168;&#x5C40;&#x53D8;&#x91CF; <code>cachedStructTypes</code> &#x7C7B;&#x8BB0;&#x5F55;&#x5386;&#x53F2;&#x5206;&#x6790;&#x7ED3;&#x679C;&#x3002;</p>
<h2 id="&#x5B9A;&#x4E49;&#x7279;&#x6B8A;&#x7684;&#x6570;&#x503C;&#x7C7B;&#x578B;&#x7ED3;&#x6784;&#x4F53;"><a name="&#x5B9A;&#x4E49;&#x7279;&#x6B8A;&#x7684;&#x6570;&#x503C;&#x7C7B;&#x578B;&#x7ED3;&#x6784;&#x4F53;" class="anchor-navigation-ex-anchor" href="#&#x5B9A;&#x4E49;&#x7279;&#x6B8A;&#x7684;&#x6570;&#x503C;&#x7C7B;&#x578B;&#x7ED3;&#x6784;&#x4F53;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x5B9A;&#x4E49;&#x7279;&#x6B8A;&#x7684;&#x6570;&#x503C;&#x7C7B;&#x578B;&#x7ED3;&#x6784;&#x4F53;</h2>
<p>&#x6709;&#x4E00;&#x4E9B; Go &#x7ED3;&#x6784;&#x4F53;&#xFF0C;&#x770B;&#x8D77;&#x6765;&#x50CF;&#x662F;&#x5305;&#x542B;&#x4E86;&#x6307;&#x9488;&#x9700;&#x8981;&#x6DF1;&#x62F7;&#x8D1D;&#xFF0C;&#x4F46;&#x5B9E;&#x9645;&#x4E0A;&#x5E94;&#x8BE5;&#x59CB;&#x7EC8;&#x5F53;&#x505A;&#x503C;&#x7C7B;&#x578B;&#x6765;&#x4F7F;&#x7528;&#x3002;</p>
<p>&#x8FD9;&#x91CC;&#x9762;&#x6709;&#x4E0B;&#x9762;&#x51E0;&#x4E2A;&#x5178;&#x578B;&#x7684;&#x7C7B;&#x578B;&#xFF0C;&#x6211;&#x4EEC;&#x6B63;&#x5E38;&#x4F7F;&#x7528;&#x7684;&#x65F6;&#x5019;&#x5728;&#x51FD;&#x6570;&#x4E2D;&#x90FD;&#x662F;&#x4F20;&#x503C;&#xFF0C;&#x800C;&#x4E0D;&#x662F;&#x4F20;&#x6307;&#x9488;&#xFF1A;</p>
<ul>
<li><code>time.Time</code> &#x8868;&#x793A;&#x65F6;&#x95F4;&#xFF0C;&#x8FD9;&#x91CC;&#x9762;&#x867D;&#x7136;&#x6709;&#x4E00;&#x4E2A; <code>loc *time.Location</code> &#x5B57;&#x6BB5;&#xFF0C;&#x4F46;&#x5B9E;&#x9645;&#x4E0A;&#x4E0D;&#x9700;&#x8981;&#x62F7;&#x8D1D;&#xFF0C;&#x8FD9;&#x4E2A; <code>loc</code> &#x6307;&#x5411;&#x7684;&#x662F;&#x4E00;&#x6BB5;&#x53EA;&#x8BFB;&#x7684;&#x5185;&#x5BB9;&#x3002;</li>
<li><code>reflect.Value</code> &#x8868;&#x793A;&#x53CD;&#x5C04;&#x503C;&#xFF0C;&#x8FD9;&#x91CC;&#x9762;&#x6709;&#x6BD4;&#x8F83;&#x590D;&#x6742;&#x7684;&#x6307;&#x9488;&#x4FE1;&#x606F;&#xFF0C;&#x4F46;&#x7531;&#x4E8E;&#x8FD9;&#x4E2A;&#x503C;&#x4EC5;&#x4EC5;&#x662F;&#x4E00;&#x4E2A;&#x5B9E;&#x9645;&#x7C7B;&#x578B;&#x7684;&#x300C;&#x4EE3;&#x7406;&#x300D;&#xFF0C;&#x6DF1;&#x5EA6;&#x62F7;&#x8D1D;&#x8FD9;&#x4E2A;&#x6570;&#x636E;&#x5E76;&#x65E0;&#x5B9E;&#x9645;&#x610F;&#x4E49;&#x3002;</li>
</ul>
<p>&#x76F8;&#x4FE1;&#x5728;&#x4E1A;&#x52A1;&#x4EE3;&#x7801;&#x4E2D;&#x4E5F;&#x53EF;&#x80FD;&#x4F1A;&#x6709;&#x7C7B;&#x4F3C;&#x7684;&#x6570;&#x503C;&#x7C7B;&#x578B;&#x7ED3;&#x6784;&#x4F53;&#xFF0C;&#x4E3A;&#x4E86;&#x80FD;&#x4E89;&#x53D6;&#x5904;&#x7406;&#x8FD9;&#x4E9B;&#x60C5;&#x51B5;&#xFF0C;&#x4EE3;&#x7801;&#x91CC;&#x63D0;&#x4F9B;&#x4E86;&#x4E00;&#x4E2A; <code>MarkAsScalar</code> &#x7684;&#x51FD;&#x6570;&#xFF0C;&#x5C06;&#x8FD9;&#x4E9B;&#x7C7B;&#x578B;&#x7EDF;&#x7EDF;&#x52A0;&#x5165;&#x5230;&#x4E00;&#x4E2A;&#x5168;&#x5C40;&#x767D;&#x540D;&#x5355;&#x91CC;&#x9762;&#xFF0C;&#x51E1;&#x662F;&#x8FD9;&#x4E9B;&#x7C7B;&#x578B;&#x7684;&#x5B57;&#x6BB5;&#x90FD;&#x4F1A;&#x88AB;&#x770B;&#x505A;&#x7B80;&#x5355;&#x7684;&#x6570;&#x503C;&#x8FDB;&#x884C;&#x6D45;&#x62F7;&#x8D1D;&#x3002;</p>
<p>&#x6B64;&#x5916;&#xFF0C;&#x8FD8;&#x6709; <code>reflect.Type</code> &#x8FD9;&#x4E2A;&#x7279;&#x6B8A;&#x7684; <code>interface</code> &#x4E5F;&#x9700;&#x8981;&#x5355;&#x72EC;&#x5904;&#x7406;&#xFF0C;&#x5B83;&#x5B9E;&#x9645;&#x662F; <code>*reflect.rtype</code> &#x7C7B;&#x578B;&#xFF0C;&#x8FD9;&#x4E2A;&#x7C7B;&#x578B;&#x6307;&#x5411;&#x7A0B;&#x5E8F;&#x7684;&#x53EA;&#x8BFB;&#x5185;&#x5B58;&#x7A7A;&#x95F4;&#xFF0C;&#x4E5F;&#x4E0D;&#x5E94;&#x8BE5;&#x6DF1;&#x5EA6;&#x62F7;&#x8D1D;&#x3002;&#x4E0D;&#x8FC7;&#x7531;&#x4E8E;&#x5B83;&#x7684;&#x72EC;&#x7279;&#x6027;&#xFF0C;&#x6CA1;&#x6709;&#x4EFB;&#x4F55;&#x4E00;&#x4E2A;&#x7C7B;&#x578B;&#x4E0E;&#x4E4B;&#x76F8;&#x4F3C;&#xFF0C;&#x4EE3;&#x7801;&#x4E2D;&#x5C31;&#x76F4;&#x63A5;&#x8FDB;&#x884C;&#x4E86;&#x7279;&#x6B8A;&#x5904;&#x7406;&#x3002;</p>
<h2 id="&#x62F7;&#x8D1D;&#x51FD;&#x6570;&#x6307;&#x9488;"><a name="&#x62F7;&#x8D1D;&#x51FD;&#x6570;&#x6307;&#x9488;" class="anchor-navigation-ex-anchor" href="#&#x62F7;&#x8D1D;&#x51FD;&#x6570;&#x6307;&#x9488;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x62F7;&#x8D1D;&#x51FD;&#x6570;&#x6307;&#x9488;</h2>
<p>&#x7ECF;&#x8FC7;&#x4E0A;&#x9762;&#x7684;&#x63A2;&#x7D22;&#xFF0C;&#x57FA;&#x672C;&#x89E3;&#x51B3;&#x4E86;&#x5927;&#x90E8;&#x5206;&#x7684;&#x6DF1;&#x62F7;&#x8D1D;&#x95EE;&#x9898;&#xFF0C;&#x4F46;&#x5B9E;&#x9645;&#x4E2D;&#x53D1;&#x73B0;&#x8FD8;&#x6709;&#x4E00;&#x4E2A;&#x975E;&#x5E38;&#x96BE;&#x5543;&#x7684;&#x786C;&#x9AA8;&#x5934;&#xFF0C;&#x5373;&#x51FD;&#x6570;&#x6307;&#x9488;&#x7684;&#x62F7;&#x8D1D;&#x3002;</p>
<p>&#x5982;&#x679C;&#x6211;&#x4EEC;&#x6709;&#x4E0B;&#x9762;&#x7684;&#x6570;&#x636E;&#x7ED3;&#x6784;&#xFF1A;</p>
<pre class="language-"><code class="lang-go"><span class="token keyword">type</span> T3 <span class="token keyword">struct</span> <span class="token punctuation">{</span>
    fn <span class="token keyword">func</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
<span class="token punctuation">}</span>
</code></pre>
<p>&#x8FD9;&#x4E2A; <code>fn</code> &#x672C;&#x8D28;&#x4E0A;&#x662F;&#x4E00;&#x4E2A;&#x6307;&#x9488;&#xFF0C;&#x8003;&#x8651;&#x5230;&#x51FD;&#x6570;&#x672C;&#x8EAB;&#x5728;&#x8FD0;&#x884C;&#x65F6;&#x662F;&#x53EA;&#x8BFB;&#x7684;&#xFF0C;&#x4E00;&#x822C;&#x60C5;&#x51B5;&#x4E0B;&#x7B80;&#x5355;&#x5F53;&#x505A; <code>uintptr</code> &#x62F7;&#x8D1D;&#x503C;&#x5C31;&#x597D;&#x4E86;&#x3002;</p>
<p>&#x4F46;&#x51E1;&#x662F;&#x90FD;&#x6709;&#x4E07;&#x4E00;&#xFF0C;&#x5F53;&#x9047;&#x5230;&#x4E0B;&#x9762;&#x8FD9;&#x79CD;&#x975E;&#x5E38;&#x590D;&#x6742;&#x7684;&#x60C5;&#x51B5;&#x65F6;&#xFF0C;&#x6D45;&#x62F7;&#x8D1D;&#x5E76;&#x4E0D;&#x53EF;&#x884C;&#x3002;</p>
<pre class="language-"><code class="lang-go"><span class="token keyword">type</span> T4 <span class="token keyword">struct</span> <span class="token punctuation">{</span>
    fn <span class="token keyword">func</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token builtin">int</span>
    m  <span class="token keyword">map</span><span class="token punctuation">[</span><span class="token builtin">int</span><span class="token punctuation">]</span><span class="token keyword">interface</span><span class="token punctuation">{</span><span class="token punctuation">}</span>
<span class="token punctuation">}</span>

t <span class="token operator">:=</span> T4<span class="token punctuation">{</span>
    m<span class="token punctuation">:</span> <span class="token keyword">map</span><span class="token punctuation">[</span><span class="token builtin">int</span><span class="token punctuation">]</span><span class="token keyword">interface</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">{</span>
        <span class="token number">0</span><span class="token punctuation">:</span> T4<span class="token punctuation">{</span>
            fn<span class="token punctuation">:</span> bytes<span class="token punctuation">.</span><span class="token function">NewBuffer</span><span class="token punctuation">(</span><span class="token boolean">nil</span><span class="token punctuation">)</span><span class="token punctuation">.</span>Len<span class="token punctuation">,</span> <span class="token comment">// fn &#x6307;&#x5411;&#x4E00;&#x4E2A;&#x7ED1;&#x5B9A;&#x4E86; receiver &#x7684;&#x65B9;&#x6CD5;&#x3002;</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
<span class="token punctuation">}</span>
</code></pre>
<p>&#x5F88;&#x663E;&#x7136;&#xFF0C;&#x5728;&#x62F7;&#x8D1D; <code>m</code> &#x7684;&#x65F6;&#x5019;&#x5FC5;&#x987B;&#x904D;&#x5386;&#x8FD9;&#x4E2A; <code>map</code> &#x6240;&#x6709;&#x5143;&#x7D20;&#xFF0C;&#x62FF;&#x5230; <code>interface{}</code> &#x5177;&#x4F53;&#x503C;&#x518D;&#x8FDB;&#x884C;&#x62F7;&#x8D1D;&#x3002;&#x7531;&#x4E8E; <code>reflect</code> &#x63A5;&#x53E3;&#x7684;&#x9650;&#x5236;&#xFF0C;&#x5728;&#x8FD9;&#x4E2A;&#x573A;&#x666F;&#x4E2D;&#x6211;&#x4EEC;&#x65E0;&#x6CD5;&#x62FF;&#x5230; <code>T4</code> &#x7684;&#x5185;&#x5B58;&#x4F4D;&#x7F6E;&#xFF0C;&#x53EA;&#x80FD;&#x7528;&#x8001;&#x65B9;&#x6CD5;&#x53BB;&#x904D;&#x5386;&#x6BCF;&#x4E2A;&#x5B57;&#x6BB5;&#x8FDB;&#x884C;&#x9010;&#x4E00;&#x62F7;&#x8D1D;&#xFF0C;&#x6B63;&#x5E38;&#x60C5;&#x51B5;&#x4E0B;&#x4E00;&#x5207;&#x90FD;&#x6CA1;&#x95EE;&#x9898;&#xFF0C;&#x4F46;&#x5F88;&#x4E0D;&#x5E78;&#x7684;&#x662F;&#xFF0C;&#x552F;&#x72EC;&#x53EA;&#x6709;&#x5F53; <code>fn</code> &#x6307;&#x5411;&#x4E00;&#x4E2A;&#x7ED1;&#x5B9A;&#x4E86; receiver &#x7684;&#x65B9;&#x6CD5;&#x7684;&#x65F6;&#x5019;&#xFF0C;<code>reflect.Value</code> &#x7684; <code>Pointer</code> &#x65B9;&#x6CD5;&#x8FD4;&#x56DE;&#x7684;&#x5730;&#x5740;&#x662F;&#x4E2A;&#x5047;&#x5730;&#x5740;&#xFF0C;&#x8FD9;&#x5BFC;&#x81F4;&#x6211;&#x4EEC;&#x65E0;&#x6CD5;&#x6B63;&#x786E;&#x62F7;&#x8D1D; <code>fn</code> &#x7684;&#x503C;&#x3002;</p>
<p>Go runtime &#x91CC;&#x9762;&#x76F8;&#x5173;&#x4EE3;&#x7801;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre class="language-"><code class="lang-go"><span class="token keyword">func</span> <span class="token punctuation">(</span>v Value<span class="token punctuation">)</span> <span class="token function">Pointer</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token builtin">uintptr</span> <span class="token punctuation">{</span>
    k <span class="token operator">:=</span> v<span class="token punctuation">.</span><span class="token function">kind</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
    <span class="token keyword">switch</span> k <span class="token punctuation">{</span>
    <span class="token comment">// &#x7701;&#x7565;...</span>

    <span class="token keyword">case</span> Func<span class="token punctuation">:</span>
        <span class="token keyword">if</span> v<span class="token punctuation">.</span>flag<span class="token operator">&amp;</span>flagMethod <span class="token operator">!=</span> <span class="token number">0</span> <span class="token punctuation">{</span>
            <span class="token comment">// As the doc comment says, the returned pointer is an</span>
            <span class="token comment">// underlying code pointer but not necessarily enough to</span>
            <span class="token comment">// identify a single function uniquely. All method expressions</span>
            <span class="token comment">// created via reflect have the same underlying code pointer,</span>
            <span class="token comment">// so their Pointers are equal. The function used here must</span>
            <span class="token comment">// match the one used in makeMethodValue.</span>
            f <span class="token operator">:=</span> methodValueCall
            <span class="token keyword">return</span> <span class="token operator">*</span><span class="token operator">*</span><span class="token punctuation">(</span><span class="token operator">*</span><span class="token operator">*</span><span class="token builtin">uintptr</span><span class="token punctuation">)</span><span class="token punctuation">(</span>unsafe<span class="token punctuation">.</span><span class="token function">Pointer</span><span class="token punctuation">(</span><span class="token operator">&amp;</span>f<span class="token punctuation">)</span><span class="token punctuation">)</span>
        <span class="token punctuation">}</span>

    <span class="token comment">// &#x7701;&#x7565;...</span>
<span class="token punctuation">}</span>
</code></pre>
<p>&#x53EF;&#x4EE5;&#x770B;&#x5230;&#xFF0C;&#x5F53; <code>flagMethod</code> &#x6807;&#x8BB0;&#x8BBE;&#x4E0A;&#x65F6;&#xFF0C;&#x5373;&#x4E0A;&#x9762;&#x6240;&#x8BF4;&#x7684;&#x8FD9;&#x79CD; <code>fn</code> &#x7684;&#x503C;&#xFF0C; <code>Pointer</code> &#x65B9;&#x6CD5;&#x4E0D;&#x4F1A;&#x8BDA;&#x5B9E;&#x7684;&#x8FD4;&#x56DE;&#x51FD;&#x6570;&#x6307;&#x9488;&#x3002; Go &#x8FD9;&#x6837;&#x8BBE;&#x8BA1;&#x5F88;&#x53EF;&#x80FD;&#x662F;&#x4E3A;&#x4E86;&#x63A9;&#x76D6; runtime &#x5728;&#x51FD;&#x6570;&#x6307;&#x9488;&#x4E0A;&#x505A;&#x7684; trick&#xFF1A;&#x4E00;&#x822C;&#x6765;&#x8BF4;&#xFF0C;<code>fn</code> &#x6307;&#x5411;&#x4E00;&#x4E2A;&#x51FD;&#x6570;&#x6307;&#x9488;&#xFF0C;&#x5373;&#x4EE3;&#x7801;&#x6BB5;&#x7684;&#x5185;&#x5B58;&#x4F4D;&#x7F6E;&#xFF0C;&#x4F46; Go &#x4E3A;&#x4E86;&#x80FD;&#x8BA9;&#x51FD;&#x6570;&#x6307;&#x9488;&#x7ED1;&#x5B9A; receiver&#xFF0C; &#x5728;&#x8FD9;&#x79CD;&#x60C5;&#x51B5;&#x4E0B; <code>fn</code> &#x4F1A;&#x6307;&#x5411;&#x4E00;&#x4E2A;&#x5305;&#x542B;&#x4E86;&#x4E0A;&#x4E0B;&#x6587;&#x4FE1;&#x606F;&#x7684;&#x7ED3;&#x6784;&#xFF0C;<code>reflect</code> &#x4E3A;&#x4E86;&#x5728;&#x8FD9;&#x79CD;&#x72B6;&#x51B5;&#x4E0B;&#x4F9D;&#x7136;&#x8BA9;&#x8C03;&#x7528;&#x8005;&#x611F;&#x89C9; <code>fn</code> &#x662F;&#x4E00;&#x4E2A;&#x4EE3;&#x7801;&#x6BB5;&#x5730;&#x5740;&#x5C31;&#x505A;&#x4E86;&#x8FD9;&#x4E2A;&#x4F2A;&#x88C5;&#x3002;</p>
<p>&#x5173;&#x4E8E; Go runtime &#x600E;&#x4E48;&#x5B9E;&#x73B0;&#x51FD;&#x6570;&#x6307;&#x9488;&#xFF0C;&#x8BE6;&#x89C1;&#x5B98;&#x65B9;&#x6587;&#x6863; <a href="https://link.zhihu.com/?target=https%3A//golang.org/s/go11func" target="_blank">https://golang.org/s/go11func</a>&#x3002;</p>
<p>&#x4E3A;&#x4E86;&#x89E3;&#x51B3;&#x8FD9;&#x4E2A;&#x95EE;&#x9898;&#xFF0C;&#x6211;&#x4EEC;&#x91CD;&#x65B0;&#x601D;&#x8003;&#x4E86;&#x8FD9;&#x4E2A;&#x7EC6;&#x8282;&#x7684;&#x62F7;&#x8D1D;&#x7B56;&#x7565;&#x3002;&#x5982;&#x679C;&#x62FF;&#x4E0D;&#x5230;&#x771F;&#x5B9E;&#x7684;&#x503C;&#x540C;&#x65F6;&#x53C8;&#x4E0D;&#x60F3;&#x8FC7;&#x5EA6;&#x4F9D;&#x8D56; Go runtime &#x7684;&#x5177;&#x4F53;&#x5B9E;&#x73B0;&#xFF0C;&#x8FD8;&#x6709;&#x4E00;&#x4E2A;&#x7B80;&#x5355;&#x53EF;&#x884C;&#x7684;&#x65B9;&#x6CD5;&#x662F;&#x4F7F;&#x7528; <code>reflect.Value</code> &#x7684; <code>Set</code> &#x65B9;&#x6CD5;&#x76F4;&#x63A5;&#x8BBE;&#x7F6E;&#x503C;&#xFF08;&#x56DE;&#x5230;&#x6700;&#x539F;&#x59CB;&#x7684;&#x65B9;&#x6848;&#xFF09;&#xFF0C;&#x4F46;&#x8FD9;&#x91CC;&#x9762;&#x6709;&#x4E2A;&#x524D;&#x63D0;&#x662F;&#x5B57;&#x6BB5;&#x5FC5;&#x987B; <code>CanSet</code>&#xFF0C;&#x4E14;&#x8BBE;&#x7F6E;&#x8FDB;&#x53BB;&#x7684;&#x503C;&#x4E0D;&#x80FD;&#x662F;&#x79C1;&#x6709;&#x5B57;&#x6BB5;&#x3002;</p>
<p>&#x4EE5;&#x4E0B;&#x662F; Go <code>reflect</code> &#x5E93;&#x7684;&#x76F8;&#x5173;&#x4EE3;&#x7801;&#xFF1A;</p>
<pre class="language-"><code class="lang-go"><span class="token comment">// Set assigns x to the value v.</span>
<span class="token comment">// It panics if CanSet returns false.</span>
<span class="token comment">// As in Go, x&apos;s value must be assignable to v&apos;s type.</span>
<span class="token keyword">func</span> <span class="token punctuation">(</span>v Value<span class="token punctuation">)</span> <span class="token function">Set</span><span class="token punctuation">(</span>x Value<span class="token punctuation">)</span> <span class="token punctuation">{</span>
    v<span class="token punctuation">.</span><span class="token function">mustBeAssignable</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token comment">// v &#x5FC5;&#x987B; CanSet&#x3002;</span>
    x<span class="token punctuation">.</span><span class="token function">mustBeExported</span><span class="token punctuation">(</span><span class="token punctuation">)</span>   <span class="token comment">// x &#x5FC5;&#x987B;&#x4E0D;&#x80FD;&#x662F;&#x79C1;&#x6709;&#x5B57;&#x6BB5;&#x3002;</span>

    <span class="token comment">// &#x7701;&#x7565;...</span>
<span class="token punctuation">}</span>

<span class="token comment">// mustBeExported panics if f records that the value was obtained using</span>
<span class="token comment">// an unexported field.</span>
<span class="token keyword">func</span> <span class="token punctuation">(</span>f flag<span class="token punctuation">)</span> <span class="token function">mustBeExported</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">if</span> f <span class="token operator">==</span> <span class="token number">0</span> <span class="token operator">||</span> f<span class="token operator">&amp;</span>flagRO <span class="token operator">!=</span> <span class="token number">0</span> <span class="token punctuation">{</span>
        <span class="token comment">// &#x8C03;&#x7528; panic...</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre>
<p>&#x56E0;&#x6B64;&#xFF0C;&#x4E3A;&#x4E86;&#x80FD;&#x591F;&#x6B63;&#x5E38;&#x7684;&#x8C03;&#x7528; <code>Set</code> &#x65B9;&#x6CD5;&#xFF0C;&#x6211;&#x4EEC;&#x4E0D;&#x5F97;&#x4E0D;&#x62FF;&#x51FA;&#x7EC8;&#x6781;&#x5927;&#x62DB;&#xFF0C;&#x76F4;&#x63A5;&#x7BE1;&#x6539; <code>reflect.Value</code> &#x91CC;&#x9762;&#x7684;&#x6807;&#x5FD7;&#x4F4D;&#xFF0C;&#x5173;&#x952E;&#x5C31;&#x662F;&#x53BB;&#x6389; <code>fn</code> &#x8FD9;&#x4E2A;&#x79C1;&#x6709;&#x5B57;&#x6BB5;&#x7684; <code>flagRO</code> &#x6807;&#x5FD7;&#x4F4D;&#x3002;</p>
<p>&#x76F4;&#x63A5;&#x53BB; hack <code>reflect.Value</code> &#x7684;&#x79C1;&#x6709;&#x5B57;&#x6BB5;&#x662F;&#x4E0D;&#x9760;&#x8C31;&#x7684;&#xFF0C;&#x672A;&#x6765;&#x592A;&#x96BE;&#x4EE5;&#x7EF4;&#x62A4;&#xFF0C;&#x8003;&#x8651;&#x5230;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x76F8;&#x5BF9;&#x5B89;&#x5168;&#x7684;&#x6D45;&#x62F7;&#x8D1D; <code>interface{}</code> &#xFF0C;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x4E00;&#x4E2A;&#x7A7A;&#x63A5;&#x53E3;&#x8FDB;&#x884C;&#x4E2D;&#x8F6C;&#x800C;&#x95F4;&#x63A5;&#x7684;&#x53BB;&#x6389;&#x8FD9;&#x4E2A;&#x6807;&#x8BB0;&#x4F4D;&#x4E14;&#x4E0D;&#x7834;&#x574F;&#x5176;&#x4ED6;&#x7684;&#x6807;&#x8BB0;&#x3002;</p>
<pre class="language-"><code class="lang-go"><span class="token comment">// typeOfInterface &#x662F; interface{} &#x8FD9;&#x79CD;&#x7C7B;&#x578B;&#x672C;&#x8EAB;&#x3002;</span>
<span class="token keyword">var</span> typeOfInterface <span class="token operator">=</span> reflect<span class="token punctuation">.</span><span class="token function">TypeOf</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token operator">*</span><span class="token keyword">interface</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">(</span><span class="token boolean">nil</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">Elem</span><span class="token punctuation">(</span><span class="token punctuation">)</span>

<span class="token comment">// forceClearROFlag clears all RO flags in v to make v accessible.</span>
<span class="token comment">// It&apos;s a hack based on the fact that InterfaceData is always available on RO data.</span>
<span class="token comment">// This hack can be broken in any Go version.</span>
<span class="token comment">// Don&apos;t use it unless we have no choice, e.g. copying func in some edge cases.</span>
<span class="token keyword">func</span> <span class="token function">forceClearROFlag</span><span class="token punctuation">(</span>v reflect<span class="token punctuation">.</span>Value<span class="token punctuation">)</span> reflect<span class="token punctuation">.</span>Value <span class="token punctuation">{</span>
    <span class="token keyword">var</span> i <span class="token keyword">interface</span><span class="token punctuation">{</span><span class="token punctuation">}</span>

    v <span class="token operator">=</span> v<span class="token punctuation">.</span><span class="token function">Convert</span><span class="token punctuation">(</span>typeOfInterface<span class="token punctuation">)</span> <span class="token comment">// &#x5C06;&#x4EFB;&#x610F;&#x7684;&#x7C7B;&#x578B;&#x5F3A;&#x5236;&#x8F6C;&#x6210; interface{}&#xFF0C;&#x786E;&#x4FDD; v &#x5185;&#x5B58;&#x5E03;&#x5C40;&#x53EF;&#x63A7;&#x3002;</span>
    nv <span class="token operator">:=</span> reflect<span class="token punctuation">.</span><span class="token function">ValueOf</span><span class="token punctuation">(</span><span class="token operator">&amp;</span>i<span class="token punctuation">)</span>      <span class="token comment">// i &#x662F;&#x5C40;&#x90E8;&#x53D8;&#x91CF;&#xFF0C;&#x4E0D;&#x4F1A;&#x8BBE;&#x7F6E; flagRO&#x3002;</span>
    <span class="token operator">*</span><span class="token punctuation">(</span><span class="token operator">*</span><span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token builtin">uintptr</span><span class="token punctuation">)</span><span class="token punctuation">(</span>unsafe<span class="token punctuation">.</span><span class="token function">Pointer</span><span class="token punctuation">(</span>nv<span class="token punctuation">.</span><span class="token function">Pointer</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token operator">=</span> v<span class="token punctuation">.</span><span class="token function">InterfaceData</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token comment">// &#x6D45;&#x62F7;&#x8D1D; v &#x7684;&#x5185;&#x5BB9;&#x5230; i.</span>
    <span class="token keyword">return</span> nv<span class="token punctuation">.</span><span class="token function">Elem</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">Elem</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token comment">// &#x8FD4;&#x56DE;&#x539F;&#x6765; v &#x6307;&#x5411;&#x7684;&#x771F;&#x5B9E;&#x5185;&#x5BB9;&#x3002;</span>
<span class="token punctuation">}</span>
</code></pre>
<p>&#x81F3;&#x6B64;&#xFF0C;&#x6211;&#x4EEC;&#x5C31;&#x53EF;&#x4EE5;&#x6B63;&#x5E38;&#x7684;&#x901A;&#x8FC7; <code>Set</code> &#x6765;&#x8BBE;&#x7F6E;&#x8FD9;&#x4E2A;&#x53CD;&#x5C04;&#x503C;&#x4E86;&#xFF0C;&#x6700;&#x540E;&#x518D;&#x5C06;&#x590D;&#x5236;&#x51FA;&#x6765;&#x7684;&#x503C;&#x901A;&#x8FC7;&#x5185;&#x5B58;&#x64CD;&#x4F5C;&#x62F7;&#x8D1D;&#x5230;&#x7ED3;&#x6784;&#x91CC;&#x9762;&#x53BB;&#x5373;&#x53EF;&#x3002;</p>
<h2 id="&#x5C0F;&#x7ED3;"><a name="&#x5C0F;&#x7ED3;" class="anchor-navigation-ex-anchor" href="#&#x5C0F;&#x7ED3;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x5C0F;&#x7ED3;</h2>
<p>&#x901A;&#x8FC7;&#x5229;&#x7528; Go &#x6570;&#x636E;&#x7ED3;&#x6784;&#x5185;&#x5B58;&#x5E03;&#x5C40;&#x7684;&#x7279;&#x70B9;&#xFF0C;&#x5148;&#x8FDB;&#x884C;&#x6D45;&#x62F7;&#x8D1D;&#x518D;&#x5BF9;&#x6709;&#x9700;&#x8981;&#x7684;&#x5B57;&#x6BB5;&#x8FDB;&#x884C;&#x6DF1;&#x62F7;&#x8D1D;&#xFF0C;&#x5E76;&#x4E14;&#x9884;&#x5148;&#x5C06;&#x7ED3;&#x6784;&#x5B57;&#x6BB5;&#x7684;&#x7C7B;&#x578B;&#x4FE1;&#x606F;&#x7F13;&#x5B58;&#x8D77;&#x6765;&#x65B9;&#x4FBF;&#x5904;&#x7406;&#xFF0C;&#x8FD9;&#x6837;&#x53EF;&#x4EE5;&#x6781;&#x5927;&#x7684;&#x63D0;&#x5347;&#x62F7;&#x8D1D;&#x6027;&#x80FD;&#x3002;&#x5BF9;&#x4E8E;&#x5B57;&#x6BB5;&#x90FD;&#x662F;&#x7EAF;&#x6570;&#x503C;&#x7C7B;&#x578B;&#x6765;&#x8BF4;&#xFF0C;&#x53EF;&#x4EE5;&#x63D0;&#x5347;&#x8D85;&#x8FC7;&#x4E00;&#x4E2A;&#x6570;&#x91CF;&#x7EA7;&#x7684;&#x6027;&#x80FD;&#xFF1B;&#x5BF9;&#x4E8E;&#x672C;&#x8EAB;&#x5C31;&#x5F88;&#x590D;&#x6742;&#x7684;&#x7C7B;&#x578B;&#x6765;&#x8BF4;&#xFF0C;&#x4E5F;&#x4F1A;&#x56E0;&#x4E3A;&#x51CF;&#x5C11;&#x4E86;&#x53CD;&#x5C04;&#x8C03;&#x7528;&#x800C;&#x63D0;&#x5347;&#x51E0;&#x500D;&#x6027;&#x80FD;&#x3002;&#x5177;&#x4F53;&#x7684;&#x6D4B;&#x8BD5;&#x7ED3;&#x679C;&#x53EF;&#x4EE5;&#x770B;&#x9879;&#x76EE;&#x7684; README&#x3002;</p>
<p>&#x57FA;&#x4E8E;&#x8FD9;&#x79CD;&#x975E;&#x5E38;&#x5F7B;&#x5E95;&#x548C;&#x9AD8;&#x6548;&#x7684;&#x6DF1;&#x62F7;&#x8D1D;&#xFF0C;&#x4F7F;&#x5F97;&#x6211;&#x4EEC;&#x751A;&#x81F3;&#x4E8E;&#x53EF;&#x4EE5;&#x7528;&#x8FD9;&#x79CD;&#x6280;&#x672F;&#x6765;&#x5B9E;&#x73B0;&#x4E00;&#x4E9B;&#x539F;&#x6765;&#x4E0D;&#x6562;&#x60F3;&#x7684;&#x529F;&#x80FD;&#xFF0C;&#x6BD4;&#x5982; Go &#x7684; immutable data&#xFF0C;&#x8FD9;&#x4E5F;&#x5C31;&#x662F; <a href="https://link.zhihu.com/?target=https%3A//pkg.go.dev/github.com/huandu/go-clone%3Ftab%3Ddoc%23Wrap" target="_blank">clone.Wrap</a>&#x3001;<a href="https://link.zhihu.com/?target=https%3A//pkg.go.dev/github.com/huandu/go-clone%3Ftab%3Ddoc%23Unwrap" target="_blank">clone.Unwrap</a> &#x548C; <a href="https://link.zhihu.com/?target=https%3A//pkg.go.dev/github.com/huandu/go-clone%3Ftab%3Ddoc%23Undo" target="_blank">clone.Undo</a> &#x5B9E;&#x73B0;&#x7684;&#x529F;&#x80FD;&#x4E86;&#xFF0C;&#x901A;&#x8FC7;&#x8FD9;&#x4E9B; API &#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x505A;&#x5230;&#x6570;&#x636E;&#x900F;&#x660E;&#x7684;&#x4FDD;&#x5B58;&#x548C;&#x91CD;&#x7F6E;&#xFF0C;&#x6A21;&#x62DF;&#x5176;&#x4ED6;&#x8BED;&#x8A00;&#x7684; immutable &#x7279;&#x6027;&#x3002;&#x8FD9;&#x65B9;&#x9762;&#x7684;&#x5B9E;&#x73B0;&#x7EC6;&#x8282;&#x4E5F;&#x633A;&#x591A;&#x7684;&#xFF0C;&#x672A;&#x6765;&#x6709;&#x673A;&#x4F1A;&#x518D;&#x5206;&#x4EAB;&#x5427;&#x3002; </p>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; caixisheng 2017 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x8BE5;&#x6587;&#x4EF6;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2021-04-14 17:07:56
</span></footer> <link rel="stylesheet" type="text/css" href="https://storage.googleapis.com/app.klipse.tech/css/codemirror.css"> <script>     window.klipse_settings = {         selector: ".language-klipse, .lang-eval-clojure",         selector_eval_js: ".lang-eval-js",         selector_eval_python_client: ".lang-eval-python",         selector_eval_php: ".lang-eval-php",         selector_eval_scheme: ".lang-eval-scheme",         selector_eval_ruby: ".lang-eval-ruby",         selector_reagent: ".lang-reagent",        selector_google_charts: ".lang-google-chart",        selector_es2017: ".lang-eval-es2017",        selector_jsx: ".lang-eval-jsx",        selector_transpile_jsx: ".lang-transpile-jsx",        selector_render_jsx: ".lang-render-jsx",        selector_react: ".lang-react",        selector_eval_markdown: ".lang-render-markdown",        selector_eval_lambdaway: ".lang-render-lambdaway",        selector_eval_cpp: ".lang-eval-cpp",        selector_eval_html: ".lang-render-html",        selector_sql: ".lang-eval-sql",        selector_brainfuck: "lang-eval-brainfuck",        selector_js: ".lang-transpile-cljs"    }; </script> <script src="https://storage.googleapis.com/app.klipse.tech/plugin/js/klipse_plugin.js"></script>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="./" class="navigation navigation-prev " aria-label="Previous page: Base">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="new_and_make.html" class="navigation navigation-next " aria-label="Next page: New And Make">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"Copy","level":"1.6.2.1","depth":3,"next":{"title":"New And Make","level":"1.6.2.2","depth":3,"path":"blog/golang/base/new_and_make.md","ref":"blog/golang/base/new_and_make.md","articles":[]},"previous":{"title":"Base","level":"1.6.2","depth":2,"path":"blog/golang/base/README.md","ref":"blog/golang/base/README.md","articles":[{"title":"Copy","level":"1.6.2.1","depth":3,"path":"blog/golang/base/copy.md","ref":"blog/golang/base/copy.md","articles":[]},{"title":"New And Make","level":"1.6.2.2","depth":3,"path":"blog/golang/base/new_and_make.md","ref":"blog/golang/base/new_and_make.md","articles":[]},{"title":"Readme","level":"1.6.2.3","depth":3,"path":"blog/golang/base/readme.md","ref":"blog/golang/base/readme.md","articles":[]},{"title":"Reflect","level":"1.6.2.4","depth":3,"path":"blog/golang/base/reflect.md","ref":"blog/golang/base/reflect.md","articles":[]},{"title":"String","level":"1.6.2.5","depth":3,"path":"blog/golang/base/string.md","ref":"blog/golang/base/string.md","articles":[]},{"title":"Tag","level":"1.6.2.6","depth":3,"path":"blog/golang/base/tag.md","ref":"blog/golang/base/tag.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["summary","expandable-chapters","toggle-chapters","theme-comscore","-lunr","-search","-highlight","-livereload","search-plus@^0.0.11","simple-page-toc@^0.1.1","github@^2.0.0","github-buttons@2.1.0","edit-link@^2.0.2","disqus@^0.1.0","prism@^2.1.0","prism-themes@^0.0.2","advanced-emoji@^0.2.1","anchors@^0.7.1","include-codeblock@^3.0.2","emphasize@^1.1.0","katex@^1.1.3","splitter@^0.0.8","mermaid-gb3@2.1.0","tbfed-pagefooter@^0.0.1","expandable-chapters-small@^0.1.7","sectionx@^3.1.0","donate@^1.0.2","local-video@^1.0.1","anchor-navigation-ex@0.1.8","favicon@^0.0.2","3-ba@^0.9.0","terminal@^0.3.2","alerts@^0.2.0","include-csv@^0.1.0","puml@^1.0.1","musicxml@^1.0.2","klipse@^1.2.0","versions-select@^0.1.1","-sharing","sharing-plus@^0.0.2","graph@^0.1.0","chart@^0.2.0"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright © caixisheng 2017","modify_label":"该文件修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"prism":{"css":["prism-themes/themes/prism-base16-ateliersulphurpool.light.css"]},"include-csv":{},"disqus":{"useIdentifier":false,"shortName":"gitbookuse"},"emphasize":{},"github":{"url":"https://github.com/xishengcai/xisheng.blog"},"puml":{},"simple-page-toc":{"maxDepth":3,"skipFirstH1":true},"summary":{},"splitter":{},"sharing-plus":{"qq":false,"all":["facebook","google","twitter","instapaper","linkedin","pocket","stumbleupon"],"douban":false,"facebook":true,"weibo":false,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":true,"messenger":false,"line":false,"vk":false,"pocket":true,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":false},"versions-select":{"type":"branches"},"graph":{},"donate":{"alipay":"https://cai-hello-1253732611.cos.ap-shanghai.myqcloud.com/share/zhifubao-pay.jpg","alipayText":"支付宝打赏","button":"赏","title":"","wechat":"https://cai-hello-1253732611.cos.ap-shanghai.myqcloud.com/share/weixin-pay.jpg","wechatText":"微信打赏"},"katex":{},"fontsettings":{"theme":"white","family":"sans","size":2},"musicxml":{},"sectionx":{"tag":"b"},"mermaid-gb3":{},"anchor-navigation-ex":{"isRewritePageTitle":false,"tocLevel1Icon":"fa fa-hand-o-right","tocLevel2Icon":"fa fa-hand-o-right","tocLevel3Icon":"fa fa-hand-o-right"},"favicon":{"shortcut":"favicon.ico","bookmark":"favicon.ico"},"theme-comscore":{},"prism-themes":{},"alerts":{},"github-buttons":{"repo":"xishengcai/xisheng.blog","types":["star"],"size":"small"},"3-ba":{"configuration":"auto","token":"ff100361cdce95dd4c8fb96b4009f7bc"},"expandable-chapters-small":{},"local-video":{},"klipse":{"myConfigKey":"it's the default value"},"advanced-emoji":{"embedEmojis":false},"include-codeblock":{"check":false,"edit":true,"fixlang":false,"lang":"","template":"ace","theme":"chrome","unindent":true},"sharing":{"qq":false,"all":["facebook","google","twitter","weibo","instapaper","linkedin","pocket","stumbleupon","qq","qzone"],"douban":false,"facebook":false,"weibo":true,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":false,"messenger":false,"line":false,"vk":false,"pocket":false,"google":true,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":true},"terminal":{"copyButtons":true,"fade":false,"style":"flat"},"edit-link":{"label":"Edit This Page","base":"https://github.com/xishengcai/xisheng.blog/edit/master"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":true},"anchors":{},"chart":{"type":"c3"},"toggle-chapters":{},"expandable-chapters":{},"search-plus":{}},"theme":"default","author":"xishengcai","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"这是程序员吗","language":"zh-hans","output.name":"site","links":{"sidebar":{"Home":"https://xisheng.vip"}},"gitbook":"3.2.3","description":"这是程序员吗"},"file":{"path":"blog/golang/base/copy.md","mtime":"2021-04-14T09:07:56.572Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2021-06-23T07:51:54.455Z"},"basePath":"../../..","book":{"language":""}});
        });
    </script>
</div>

        
    
    <script src="../../../gitbook/gitbook.js"></script>
    <script src="../../../gitbook/theme.js"></script>
    
        
        <script src="../../../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-toggle-chapters/toggle.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-search-plus/jquery.mark.min.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-search-plus/search.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-github/plugin.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-github-buttons/plugin.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-edit-link/plugin.js"></script>
        
    
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/URI.js/1.16.1/URI.min.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-disqus/plugin.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-mermaid-gb3/book/plugin.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-sectionx/sectionx.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-donate/plugin.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-local-video/video.min.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-3-ba/plugin.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-terminal/plugin.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-alerts/plugin.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-musicxml/osmd.min.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-musicxml/musicxml.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-musicxml/promise.min.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-versions-select/plugin.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-sharing-plus/buttons.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-theme-comscore/test.js"></script>
        
    

    <script src="../../../gitbook/gitbook-plugin-mermaid-gb3/mermaid/mermaid.min.js"></script>

    </body>
</html>

